Created
April 28, 2014 13:03
-
-
Save shemul/11371304 to your computer and use it in GitHub Desktop.
Getting good with git.. and very basic level of php
-mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: Shemul | |
* Date: 4/25/14 | |
* Time: 3:57 PM | |
* Very basic steps to php and db | |
*/ | |
error_reporting(0); | |
$con = mysql_connect('localhost','root',''); | |
if (!$con) | |
{ | |
echo 'Could not connect to the database' ; | |
} else { | |
echo 'Connected to the database'. "\n"; | |
} | |
mysql_select_db('hmm',$con); | |
$qry = mysql_query("SELECT `hmm`.`info`.* FROM `hmm`.`info` LIMIT 52"); | |
while ($chk = mysql_fetch_array($qry)) | |
{ | |
$id = $chk[id]; | |
$name = $chk[name]; | |
echo 'ID :' . $id . "\n" ; | |
echo 'Name :' . $name . "\n" ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment