Forum Moderators: coopster
My question is: is there a mysqli version of the old mysql_result function? Sometimes I just want to get a specific item of data and load it into a variable. With the regular mysql fuctions, it could go like this:
$newvar = mysql_result(mysql_query("select newvar from table where id=1",$db),0,'newvar');
but now, the shortest way I can find to do this is:
$res = $db->query("select newvar from table where id=1");
$row = $res->fetch_assoc();
$newvar = $row[0];
If you know a better way to do this in PHP5 while using mysqli (object style), please let me know.
thanks,
Dave
And they call is "Improved"... ;)