Re: [PHP] fetching DB entries

2010-06-21 Thread la...@garfieldtech.com
Performance-wise, SELECT * is slower than specifying fields (marginally). If you just want a single field then mysql_result() will be faster, but if you want multiple fields mysql_fetch_* is your best bet. As far as the PHP goes, if you know there will be only a single record I'd suggest usin

[PHP] fetching DB entries

2010-06-21 Thread Ashley Sheridan
Hi All, This is just a bit of a 'throw it out to the masses' sort of question to see what people might recommend. At the moment, if I am retrieving a single record from the DB, my code looks like this: $query = "SELECT * FROM table WHERE id=1"; $result = mysql_query($query); while($row = mysql_f