Ghostsuit
12-16-2009, 08:29 PM
Hi,
I'm looking at the new PHP widget and trying to work out how to use it and if it's possible.
I'm wanting to connect to a database and then display rows from the database but I'm a little confused on how to use the $output part.
Can anyone enlighten me?
Here's a very rough of the idea
$rows = $db->query("
SELECT *
FROM gig
");
echo '<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">';
echo '<tr class="tcat">';
echo '<td class="smallfont" align=center width="100"><b>Title</b></td>';
echo '<td class="smallfont" align=center><b>Date</b></td>';
while ($row = $db->fetch_array($rows))
{
echo '<tr class="alt2">';
echo '<td class="smallfont" align=center>' . $row[gig_title] . '</td>';
echo '<td class="smallfont" align=center>' . $row[date] . '</td>';
echo '</tr>';
}
echo '</tr>';
echo '</table>';
echo '<br />';
I'm looking at the new PHP widget and trying to work out how to use it and if it's possible.
I'm wanting to connect to a database and then display rows from the database but I'm a little confused on how to use the $output part.
Can anyone enlighten me?
Here's a very rough of the idea
$rows = $db->query("
SELECT *
FROM gig
");
echo '<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">';
echo '<tr class="tcat">';
echo '<td class="smallfont" align=center width="100"><b>Title</b></td>';
echo '<td class="smallfont" align=center><b>Date</b></td>';
while ($row = $db->fetch_array($rows))
{
echo '<tr class="alt2">';
echo '<td class="smallfont" align=center>' . $row[gig_title] . '</td>';
echo '<td class="smallfont" align=center>' . $row[date] . '</td>';
echo '</tr>';
}
echo '</tr>';
echo '</table>';
echo '<br />';