RE: [PHP-DB] DB Print Columns and Rows

2002-10-24 Thread joakim . andersson
 
Hello PHP people. I was wondering if I could get a 
 question answered?
 
How would I print a Database Table into a table when 
 the DB Table 
 has 4 columns, AND 4 rows.
 
See I only know how to print one column.

?php
// Your dB-stuff here...
$separator = ;
echo tabletr;
while($row = mysql_fetch_array($result));
{
echo $separator;
echo td . $row[0] . /td;
echo td . $row[1] . /td;
echo td . $row[2] . /td;
echo td . $row[3] . /td;
$separator = /trtr;
}
echo /tr/table;
?

Regards
Joakim

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




RE: [PHP-DB] DB Print Columns and Rows

2002-10-24 Thread Hutchins, Richard
Something like this should also work for you.

table

?php
while($row=mysql_fetch_array($sqlResult){
$var1=$row[col1];
$var2=$row[col2]; //etc., etc.

echo(trtd.$var1./tdtd.$var2./td/tr;
}
?
/table

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:Tony72284;aol.com]
 Sent: Thursday, October 24, 2002 10:55 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] DB Print Columns and Rows
 
 
 
Hello PHP people. I was wondering if I could get a 
 question answered?
 
How would I print a Database Table into a table when 
 the DB Table 
 has 4 columns, AND 4 rows.
 
See I only know how to print one column.
 

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




RE: [PHP-DB] DB Print Columns and Rows

2002-10-24 Thread Hutchins, Richard
Sorry, fixed a syntax error in my original post.

 -Original Message-
 From: Hutchins, Richard [mailto:Richard.Hutchins;GetingeCastle.com]
 Sent: Thursday, October 24, 2002 10:59 AM
 To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] DB Print Columns and Rows
 
 
 Something like this should also work for you.
 
 table
 
 ?php
 while($row=mysql_fetch_array($sqlResult){
   $var1=$row[col1];
   $var2=$row[col2]; //etc., etc.
 
   echo(trtd.$var1./tdtd.$var2./td/tr);//this line
corrected
 }
 ?
 /table
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:Tony72284;aol.com]
  Sent: Thursday, October 24, 2002 10:55 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] DB Print Columns and Rows
  
  
  
 Hello PHP people. I was wondering if I could get a 
  question answered?
  
 How would I print a Database Table into a table when 
  the DB Table 
  has 4 columns, AND 4 rows.
  
 See I only know how to print one column.
  
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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