PDA

View Full Version : MySQL Table


shaqoneal
12-04-2009, 02:09 AM
Hi guys,

And no, not the actual tables in MySQL. A <table>. :p

I wanted to know, how can we retrieve all the rows in a table and display them in a table in a vB template?

i.e., the normal code is:

<?php

$sql = "SELECT * FROM something";

echo("<table>
<tr>
<th>Something</th>
<th>Something</th>
</tr>");

while($row = mysql_fetch_array($sql)) {
echo("<tr>");
echo("<td>" . $row['first_row'] . "</td>");
echo("<td>" . $row['second_row'] . "</td>");
echo("</tr>");
}

echo("</table>");


So how can this be incorporated into a template?

kh99
12-04-2009, 04:26 AM
[deleted]