Re: inserting data into columns and rows in php.

From: Date: Tue, 25 Jul 2000 17:32:27 +0000
Subject: Re: inserting data into columns and rows in php.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8100@lists.php.net to get a copy of this message
how about: printTableHeader(); while("you have stuff from db"){ echo "<tr>"; echo "<td>".$blah."</td>; echo "<td>".$blah."</td>; echo "<td>".$blah."</td>; echo "</tr>"; } printTableFooter(); I do something like that... but i have a different table "Maniac" <maniac@online.ee> wrote in message news:397DCDD2.F6D0C340@online.ee... > Hi! > > I'm trying make a page where you have a table with 3 columns. At > different times the > page might be empty or have hundreds of cells of informatin alla > accessed from a dbase. > here is the question: How can I tell php to insert a line of code into a > page that > starts another row in the table? > > basically I have something like this: > > <tr> > <? > file://skipped the database connection part, this is the printing section, > the problem > > printf("<td>column1</td>", $myrow["data"]); > printf("<td>column2</td>", $myrow["data"]); > printf("<td>column3</td>", $myrow["data"]); > > here 3 columns of data and after that php should insert > </tr><tr> > between the lines to start another row that is 3 columns long. > > printf("<td>column4</td>", $myrow["data"]); > printf("<td>column5</td>", $myrow["data"]); > printf("<td>column6</td>", $myrow["data"]); > > until there is no more data to be inserted into the table. > > I have trouble of creating the code needed so that php would > insert </tr><tr> after every 3 rows of data from the database. > > Can anyone give a few pointer to the right direction. I hope I am > making sense, if not, let me know and I'll try to clarify the problem > a bit more. > > -- > Maniac > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#8100) next »