I have a query that used union all..
and produces a table like this:

`+-------------+------------------------+-----------+--------------+
| Type        | Name                   | IDNum     | Warnings     |
+-------------+------------------------+-----------+--------------+
| M           | sample                 | 2013-1    |            4 | 
| L           | sample                 | 2013-1    |            2 | 
+-------------+------------------------+-----------+--------------+`

now i made a while loop to get the data under the warning column:

while ($warning = mysql_fetch_objects($queryResult)){
switch($warning->Type){
case 'M': $M = $warning->Warnings;break;
case 'L': $L = $warning->Warnings;break;
}
}

but now then it only gives me the result of case M, its not looping back to check the other type to the switch case..

I need clarification and help....

Shouldn't that be mysql_fetch_object (without the 's')? Can you show some more code if that is not the problem?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.