For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > February 2007 > Re: [PHP-DB] Creating a Table to line query results in php?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Creating a Table to line query results in php?
Scott

2007-02-25, 9:58 pm

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:
> 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";
>
>
> Or am I oversimplifying?
>
> ~ matt
>
>
>
>
> On 2/25/07, Scott <sburcky@gmail.com> wrote:
> up?
>
>



--
Scott Burcky
AOL IM: Jestrix1
Chris

2007-02-25, 9:58 pm

Scott wrote:[color=darkred]
> 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/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com