Dell 4500, mem 1g, disk 45g, mhz 2g, Mysql-3.23.54a-linux-i686, PHP-4.30, httpd_2.0.44
1. How do I trap or collect or save the digit "3" generated the
mysql "SELECT COUNT(*)" statement below?
2. The PHP "SELECT FROM" below (before snip) listed the expected data.
Is there a way to get the digit "3" into a PHP variable?
SELECT h_id, name FROM tbtm # displays WHERE h_id="1" # three OR h_id="2" # lines OR h_id="3"; # of data
SELECT COUNT(*) FROM tbtm # displays WHERE h_id='1' # the OR h_id='2' # digit OR h_id='3'; # three
+----------+ | COUNT(*) | +----------+ | 3 | +----------+ 1 row in set (0.00 sec)
The next PHP is the same as the "SELECT FROM" above. <?php $result = mysql_query(" SELECT h_id, name, FROM tbtm WHERE h_id='1' OR h_id='2' OR h_id='3'", $tmtb_db);
Well, *after* you check $result to make sure that the query didn't fail (which you don't do above, but should), use the mysql_num_rows() function to determine how many rows the query returns. Something like this:
$result = mysql_query ($query) or die ("Query failed\n"); $row_count = mysql_num_rows ($result);
# printf("ID: %s<br>\n", mysql_result($result,1,"h_id")); printf("name: %s<br>\n", mysql_result($result,1,"name")); <snip> <snip> # ?>
Thanks
[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- Paul DuBois, Senior Technical Writer Madison, Wisconsin, USA MySQL AB, www.mysql.com
Are you MySQL certified? http://www.mysql.com/certification/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]