Skip to content

Instantly share code, notes, and snippets.

@shemul
Created April 28, 2014 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shemul/11371304 to your computer and use it in GitHub Desktop.
Save shemul/11371304 to your computer and use it in GitHub Desktop.
Getting good with git.. and very basic level of php -mysql
<?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