on 7/8/01 3:39 AM, Adam at [EMAIL PROTECTED] wrote:

> i want my mysql query result to output 2 mysql output rows for every <tr>
> set. I'm used to just doing a do/while statement for a single mysql output
> per row.

I'd do this:


echo '<table>';

$result = mysql_query("SELECT * from table WHERE type='default'");
$numrows = mysql_num_rows ($result);

while ($numrows) {

    $row = mysql_fetch_row ($result);
    echo "<tr>\n<td>$row[0]</td>\n";
    $row = mysql_fetch_row ($result);
    echo "<td>$row[0]</td>\n</tr>";
    $numrows = ($numrows - 2);


echo '</table>';


PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to