Bobafart
07-12-2007, 05:21 PM
what's the most efficient way to grab a single data value from a table field using PHP?
the best I have is using a while loop -- but something tells me there is a cleaner/more efficient way:
$sql="select countryType from c_countries where userid={$_SESSION[userid]}";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){ $userCountryType = $row[countryType]; }
the best I have is using a while loop -- but something tells me there is a cleaner/more efficient way:
$sql="select countryType from c_countries where userid={$_SESSION[userid]}";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){ $userCountryType = $row[countryType]; }