Re: [PHP] TABLE COLUMNS

2003-06-02 Thread Veniamin Goldin
probably something like:

echo table;
$rs=mysql_query(select * from blabla;,$conn);
while($row=mysql_fetch_row($rs)) {
  echo tr;
echo td.$row[0]./td;
echo td.$row[1]./td;
echo td.$row[2]./td;
echo td.$row[3]./td;
  echo /tr;
}
echo /table;

R I'm querying a database then printing the results in a TABLE. What I
R want to do is format the results in a TABLE with 4 columns per row.
R Any suggestions?

R Thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] TABLE COLUMNS

2003-06-02 Thread Don Read

On 02-Jun-2003 Ralph wrote:
 I'm querying a database then printing the results in a TABLE. What I
 want to do is format the results in a TABLE with 4 columns per row.
 Any suggestions?
 
 Thanks.
 

$modulo=4;
unset($a);

echo \ntable;
while($row = $r-FetchRow()) {
if (count($a) = $modulo) {
echo \n trtd, implode('/tdtd', $a), '/td/tr';
unset($a);
}
$a[]=$row['blah'] .'nbsp;' .$row['foo'];
}
while (count($a)  $modulo) {
$a[]='nbsp;';
}
echo \n trtd, implode('/tdtd', $a), '/td/tr';
echo \n/table\n;


Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php