Sometimes you just want to pull a single value from the database without a whole lot of work.  Here's how to do it in a single line;

// mysql_result() function is used to pull a single value from the database
$value = mysql_result(mysql_query("SELECT value FROM table WHERE condition = 'met'"), 0);
 

Leave a Reply