Re: Creating a Table to line query results in php?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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";

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/

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux