PDA

View Full Version : PHP/MySQL - Best way to return a single value




seventeen
Jun 28, 2009, 03:38 PM
What is the best way to return a single value from a mysql query with php? Rather than use mysql_fetch_array or assoc...

Basically is there a mysql function i can use to return the value into a single variable?

ex: $single_value = mysql_...($resource);



Volante
Jun 28, 2009, 04:23 PM
http://www.php.net/mysql_result

Retrieves the contents of one cell from a MySQL result set.

seventeen
Jun 28, 2009, 06:13 PM
wow, thanks so much. I had no idea that existed. hah.