Hi I found this question here , but it doesnt do exactly what i'm looking for.
I would like the table to be displayed like this instead:
** | array1 | array2
-------------------------------
logtime | 1305732210 | 1305732216
-------------------------------
useragent | Mozilla | Mozilla
-------------------------------
Edited:
my bad for not posting code, but here is what i'm stuck on.
i have this query that outputs an array of data from mysql
SELECT s.*, m.id AS wmMake
FROM `table1` AS s
JOIN `table2` AS m
WHERE s.code = m.code
AND (s.ic='123'
OR s.ic='1234"
its output looks like this
Array ( [0] => PAS [cat] => PAS [1] => H4B12A [ic] => H4B12A [2] => SMALL [segment] => SMALL [3] => 6 [wmMake] => 6 )
Array ( [0] => PAS [cat] => PAS [1] => HUV12A [ic] => HUV12A [2] => SMALL [segment] => SMALL [3] => 6 [wmMake] => 6 )
Now on my php side i have this:
for ($i =0; $c = mysql_fetch_array($query); $i++)
{
print_r($c);
}
the for loop, loops through 1 row at a time, how do i loop through each row, and get the 1st value and, then each row again to get 2nd value of array and so on. My html output should look like this.
** | array1 | array2
-------------------------------
cat | PAS | PAS
-------------------------------
ic | H4B12A | HUV12A
-------------------------------
segment | SMALL | SMALL
-------------------------------
wmMake | 6 | 6