uberfuzzy wrote in php 🙂bouncy

Listens: http://di.fm/ goa trance stream

whats the proper and/or common way to retrieve a single SQL result.
dont worry about checking for if there is data to retrive or not.
i'm using the built in mySQL calls.
and probly some form of php 4.3


what i usualy do is

if i'm only pulling 1 thing

$q = "SELECT thing FROM place WHERE stuff"
$r = mysql_query($q) or die(mysql_error() . "
\n$q");
$thing = mysql_result($r,0);


but if i need to pull a list of single things

$q = "SELECT thing FROM place WHERE stuff"
$r = mysql_query($q) or die(mysql_error() . "
\n$q");

while($aray = mysql_fetch_assoc($r))
{
$thing = $aray['thing'];
}


these both work, and have their own place,
i'm just wondering if there is a better/more right method that i dont know