Danny159
08-25-2007, 03:59 PM
Hey
I have this script i have just made and i want it to put all the items in the database into a table so i can view then as the admin. However i can't seem to get it to put the data into the table...:confused:
Here is the script is there any way someone can help me :S it brings up the titles to the table but not the data in the table :confused:
<?php
require('../connect.php');
$result = mysql_query("SELECT * FROM voucher WHERE id = '$id' ORDER BY $param",$db);
if (!$param) {
$result = mysql_query("SELECT * FROM voucher WHERE id = '$id' ORDER BY id",$db);
}
echo "<p><table border=1 cellspacing=0 cellpadding=2 bordercolor=#eeeeee width=400>";
echo "<tr align=top><td><b>
Coupon id#</b></td><td><b>
Name</b></td><td><b>
Coupon</b></td><td><b>
Amount</b></td></tr>";
while ($row = mysql_fetch_array($result))
{
$id = $row["id"];
$name = $row["name"];
$code = $row["code"];
$amount = $row["amount"];
echo "<tr><td>
$id</td><td>
$name</td><td>
$code</td><td>
$amount</td></tr>";
}
echo "</table>";
?>
I have this script i have just made and i want it to put all the items in the database into a table so i can view then as the admin. However i can't seem to get it to put the data into the table...:confused:
Here is the script is there any way someone can help me :S it brings up the titles to the table but not the data in the table :confused:
<?php
require('../connect.php');
$result = mysql_query("SELECT * FROM voucher WHERE id = '$id' ORDER BY $param",$db);
if (!$param) {
$result = mysql_query("SELECT * FROM voucher WHERE id = '$id' ORDER BY id",$db);
}
echo "<p><table border=1 cellspacing=0 cellpadding=2 bordercolor=#eeeeee width=400>";
echo "<tr align=top><td><b>
Coupon id#</b></td><td><b>
Name</b></td><td><b>
Coupon</b></td><td><b>
Amount</b></td></tr>";
while ($row = mysql_fetch_array($result))
{
$id = $row["id"];
$name = $row["name"];
$code = $row["code"];
$amount = $row["amount"];
echo "<tr><td>
$id</td><td>
$name</td><td>
$code</td><td>
$amount</td></tr>";
}
echo "</table>";
?>
