Wel all know that we have to use something like mysql_fetch_assoc to a mysql query to get an associative array and then use $row[‘foo’] and $row[‘bar’] to get every value.
Is there a way to optimize the query to get a simple string if we want to return a single column from a single row so that the result will be a simple var and not an associative array?
Thanks.
Use
mysql_resultfuncitonHere
$strcontains the first column of first row.Also keep in mind that
mysql_resultwill move the internal result pointer to point the next row.