willsherwood
asked on
mysql query: name vs. order-based; mysqli
i'm inheriting code that i need to fix and add features to.
they use order-based queries and there are some bugs due to incorrect index order-matching with the SELECT argument list.
1. mysql_fetch_array is used with $row[1] where the index corresponds to the SELECT arg order.
i'm accustomed to mysql_fecth_assoc where the field name is used and order is inconsequential (and much more reliable for maintenance, etc.)
is there any aspect i should be aware of regarding converting from _array to _assoc?
intuitively it seems trivial to just change the function name, and replace the index with $row['fieldname']
There are 33 fields in one query, so you can imagine the spaghetti code!
2. is there any argument change between using mysql and myslqi system function calls?
can i just blindly substitute for all combinations of mysql_* function names
thanks!
they use order-based queries and there are some bugs due to incorrect index order-matching with the SELECT argument list.
1. mysql_fetch_array is used with $row[1] where the index corresponds to the SELECT arg order.
i'm accustomed to mysql_fecth_assoc where the field name is used and order is inconsequential (and much more reliable for maintenance, etc.)
is there any aspect i should be aware of regarding converting from _array to _assoc?
intuitively it seems trivial to just change the function name, and replace the index with $row['fieldname']
There are 33 fields in one query, so you can imagine the spaghetti code!
2. is there any argument change between using mysql and myslqi system function calls?
can i just blindly substitute for all combinations of mysql_* function names
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
appreciate your help
ASKER