PHP - Simple way to read single record from MySQL


Question

What's the best way with PHP to read a single record from a MySQL database? E.g.:

SELECT id FROM games

I was trying to find an answer in the old questions, but had no luck.

1
56
10/14/2012 7:29:45 PM

$id = mysql_result(mysql_query("SELECT id FROM games LIMIT 1"),0);
58
1/5/2011 6:50:55 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon