Archives for "Knowledge"
0
Difference between php mysql functions mysql_fetch_object(), mysql_fetch_assoc() and mysql_fetch_array()
Some of my friends are asked me. What’s difference between php functions mysql_fetch_object(), mysql_fetch_assoc() and mysql_fetch_array()? and how to use it ? If you also don’t known about it , please have a look example codes below. I think you would understand it.
mysql_fetch_object()
while ($each= mysql_fetch_object($result)) {
echo $each->first_name;
echo $each->last_name;
}
mysql_fetch_assoc()
while ($each= mysql_fetch_assoc($result)) {
echo $each["first_name"];
echo $each["last_name"];
}
mysql_fetch_array()
while ($each= mysql_fetch_array($result)) {
echo $each[0];
echo $each[1] ;
}
Made by Symmetric Web
Distributed by Smashing Magazine