sheppardzwc
12-02-2009, 09:57 PM
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?
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?