<?php
$hostname = "localhost";
$username = "root";
$pass = "";
$conn = mysql_connect($hostname, $username, $pass);
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT ID FROM RECORD';
mysql_select_db('egp');
$result = mysql_query( $sql, $conn );
echo 'Numver of rows: '.mysql_num_rows($result).' <br>';
if(! $result ) {
die('No Data: ' . mysql_error());
}
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "ID :{$row['ID']} <br> ".
"--------------------------------<br>";
}
echo "Successfully Execute\n";
mysql_close($conn);
?>
No comments:
Post a Comment