inserting data into columns and rows in php.
| From: | Maniac | Date: | Tue, 25 Jul 2000 17:26:42 +0000 |
| Subject: | inserting data into columns and rows in php. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8098@lists.php.net to get a copy of this message | ||
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>
<?
//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