Hi,
i am trying to use foreach() to loop through and run several queries.
i have a variable called $row[query] which is coming out of a table which stores several queries, these queries contain a mysql select statement such as SELECT * FROM jobs where etc.
Now i would like to access them all and just print them to screen. This is what i have been using but to no avail:
if (isset($row[query]) && is_array($row[query])) {
foreach ($row[query] as $value){
echo "value: $value<br>\n";
exit;
}
}
What i expected to see was
SELECT FROM jobs WHERE country = 'AU'
SELECT FROM jobs WHERE country = 'TY'
SELECT * FROM jobs WHERE country = 'HH'
And so on for every row in my table.
Eventually these will be used to produce seperate queries themselves but for now i just want to see them listed.
i think my use of foreach is very wrong. Any help will be much appreciated.
Thanks