Mysql_query into an array
Posted: Tue Jul 17, 2007 7:52 pm
Problem: How can I put the whole mysql_query into an array that I can use array_unique on?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
.. GROUP BY `fieldname`It would be the same result as array_unique() with a lot of cruft removed, so I'm pretty sure ~ankhmor is looking for it.boo wrote:I think with distinct all of the fields that are returned would need to match rather than just 1 or 2 of the fields, but if that is what you are looking for then distinct would be the way to go. No reason to send back something you are not going to use.
You are right just looked it up in the manual after I posted since I was not sure if array_unique() looked at the whole string value.feyd wrote:It would be the same result as array_unique() with a lot of cruft removed, so I'm pretty sure ~ankhmor is looking for it.