Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- question about mysql_fetch_array ()
- William Gill
October 1, 2008, 1:03 pm
rate this thread
given the query:
SELECT * FROM customers
left join addresses
The mysql monitor returns all fields from both tables, including
repeating the field matching the on condition (cusid).
mysql_fetch_array() does not return the matching field from the joined
If I use the using() conditional I get the same non repeated result, in
both mysql monitor and mysql_fetch_array().
Is it safe rely on this non repeating property of the
I'm not sure it really makes a difference since data assignment would be
in the form of DataFromField= $row["cusid"], but I have learned from
experience that thinking something will never make any difference is risky.
Re: question about mysql_fetch_array ()
I ran into that especially if you use a lot of left joins.. what I do
now is i make sure the correct value is assigned in my query:
MySQL code includes lines like:
b.fieldname AS fieldname
btable AS b
where the are multiple instances of fieldname in various tables, but
btable has the known true value.
- » allow users to update their own info in a MySQL db
- — Next thread in » PHP Scripting Forum