RE: [PHP] get value

From: Date: Mon, 06 Aug 2001 20:14:31 +0000
Subject: RE: [PHP] get value
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61476@lists.php.net to get a copy of this message
There might be an easier way to do it, but this should work: Change your SELECT statement to "SELECT count(*) as c ....<other criteria here>" After $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); Do this: $mycount = mysql_result($result, 0, 'c') ; $mycount should now be the value held from your count in the SQL statement. HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 x289 smasiello@synacor.com -----Original Message----- From: Jeremy Morano [mailto:jeremy@prepresshelp.com] Sent: Monday, August 06, 2001 4:07 PM To: php-general@lists.php.net Subject: [PHP] get value hi,,, can someone tell me how to access the value of count? please? ---------------------------------------------------------------------------- --------- $db = @mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql = "SELECT count(*) FROM $table_name, company Where company.uid = user.companyUid and company.company = '$PHP_AUTH_USER' "; $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); ---------------------------------------------------------------------------- ---------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#61476) next »