Jump to content

[SOLVED] Difference between mysql_fetch_assoc() and mysql_fetch_array()


Yesideez

Recommended Posts

I've been playing with these two functions and can't seem to notice much difference between them and was wondering if someone would be kind enough to explain them to me please?

 

If I replace one for the other I get exactly the same data returned and I'm wondering if there is really any significant difference?

 

Which is best to use?

 

EDIT: I have been to the mysql online manuals and can't seem to understand much there :(

mysql_fetch_array returns both a numeric and an associative array while mysql_fetch_assoc returns only an associative.

 

If your using associative indexes (more readble) then using mysql_fetch_assoc is slightly more efficient.

 

I have been to the mysql online manuals and can't seem to understand much there

 

These are both php functions (part of the mysql extension), not mysql.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.