dmort Posted February 3, 2010 Share Posted February 3, 2010 I can use my variable in fetch_array ... echo $row['line1'] good. I am unable to use fetch_object with : $data = mysql_fetch_object($result); while(list($var, $value) = each($data)) $$var = $value; ... echo $value['line1']. I can't get the values out of the object to be useable. Anyone know why ? Thanks Link to comment https://forums.phpfreaks.com/topic/190768-problems-accessing-mysql_fetch_object-vs-mysql_fetch_array/ Share on other sites More sharing options...
jl5501 Posted February 3, 2010 Share Posted February 3, 2010 You read object variables with the object operator so if $data is from mysql_fetch_object() then its variables are $data->varname Also, each() takes an array as an argument, not an object Link to comment https://forums.phpfreaks.com/topic/190768-problems-accessing-mysql_fetch_object-vs-mysql_fetch_array/#findComment-1006004 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.