Re: Creating a Table to line query results in php?
| From: | Chris | Date: | Mon, 26 Feb 2007 02:13:24 +0000 |
| Subject: | Re: Creating a Table to line query results in php? | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43126@lists.php.net to get a copy of this message | ||
Scott wrote:
Thanks....I was trying to do that but was not working for me. I think I was over thinking it. The obvious is never obvious :) On 2/25/07, Matt Anderton <manderton@gmail.com> wrote:The middle ones should be <td>'s: echo "<tr>\n"; echo "<td>" . $data['Image'] . "</td>\n"; echo "<td>" . $data['Name'] . "</td>\n"; echo "<td>" . $data['Effect'] . "</td>\n"; echo "<td>" . $data['Category'] . "</td>\n"; echo "<td>" . $data['Origin'] . "</td>\n"; echo "</tr>\n"; -- Postgresql & php tutorials http://www.designmagick.com/why not just create a table? echo "<table>\n"; echo "<tr><th>Image</th><th>Name</th><th>Effect</th><th>Category</th><th>Origin</th></tr>\n"; while ($data = mysql_fetch_array($res)) { echo "<tr>\n"; echo "<tr>" . $data['Image'] . "</tr>\n"; echo "<tr>" . $data['Name'] . "</tr>\n"; echo "<tr>" . $data['Effect'] . "</tr>\n"; echo "<tr>" . $data['Category'] . "</tr>\n"; echo "<tr>" . $data['Origin'] . "</tr>\n"; echo "</tr>\n"; } echo "</table>\n";