Note that there are some explanatory texts on larger screens.

plurals
  1. POphp create table vertically from array
    primarykey
    data
    text
    <p>Hi I found this <a href="https://stackoverflow.com/questions/6047757/php-create-table-from-array">question here</a> , but it doesnt do exactly what i'm looking for. </p> <p>I would like the table to be displayed like this instead:</p> <pre><code> ** | array1 | array2 ------------------------------- logtime | 1305732210 | 1305732216 ------------------------------- useragent | Mozilla | Mozilla ------------------------------- </code></pre> <p>Edited:</p> <p>my bad for not posting code, but here is what i'm stuck on.</p> <p>i have this query that outputs an array of data from mysql</p> <pre><code>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" </code></pre> <p>its output looks like this</p> <pre><code>Array ( [0] =&gt; PAS [cat] =&gt; PAS [1] =&gt; H4B12A [ic] =&gt; H4B12A [2] =&gt; SMALL [segment] =&gt; SMALL [3] =&gt; 6 [wmMake] =&gt; 6 ) Array ( [0] =&gt; PAS [cat] =&gt; PAS [1] =&gt; HUV12A [ic] =&gt; HUV12A [2] =&gt; SMALL [segment] =&gt; SMALL [3] =&gt; 6 [wmMake] =&gt; 6 ) </code></pre> <p>Now on my php side i have this:</p> <pre><code>for ($i =0; $c = mysql_fetch_array($query); $i++) { print_r($c); } </code></pre> <p>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.</p> <pre><code> ** | array1 | array2 ------------------------------- cat | PAS | PAS ------------------------------- ic | H4B12A | HUV12A ------------------------------- segment | SMALL | SMALL ------------------------------- wmMake | 6 | 6 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload