English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1 answers

//change this variable with your host,username,
//login password and database name
$dbhost = 'localhost';
$dbuser = 'yourUsername';
$dbpass = 'yourPassword';
$dbname = 'yourDatabaseName';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error ' . mysql_error());
mysql_select_db($dbname) or die('Table Not found');

//change this variable with your query
$query = "select * from customer";

$result = mysql_query($query) or die('Query failed. ' . mysql_error());

$rowcount = mysql_num_rows($result);
echo 'result from mysql_num_rows : ' . $rowcount;

echo '
';

//change this variable with your query
$query = "select count(*) from customer";

$result = mysql_query($query) or die('Query failed. ' . mysql_error());

$rowcount = mysql_fetch_row($result);
echo 'result from query SELECT COUNT(*) : ' . $rowcount[0];
?>

2007-07-23 20:53:07 · answer #1 · answered by Manzana verde 5 · 1 0

fedest.com, questions and answers