Get options from mySQL Query - mulitple

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 20, 2011   (RSS)

Re: [rjbathgate] Get options from mySQL Query - mulitple

By Dave - April 20, 2011

Hi Rob,

Here's a few ideas. You could just do two queries and merge both record arrays into one with array_merge:
http://php.net/array_merge

$allRecords = array_merge($tableOneRecords, $tableTwoRecords);

Another option is to use MySQL UNION:
http://dev.mysql.com/doc/refman/5.0/en/union.html
(Try replacing your AND with it)

Hope the helps!
Dave Edis - Senior Developer
interactivetools.com