Hi everyone,
This one has me pulling my hair out. I am getting an error
I guess I have been looking too long because I cannot see it. Any suggestions will be greatly appreciated.
Jim
This one has me pulling my hair out. I am getting an error
Parse error: syntax error, unexpected T_STRING in /home/public_html/test/edit.php on line 30
I guess I have been looking too long because I cannot see it. Any suggestions will be greatly appreciated.
Jim
Code:
<?php
$id = $_GET['id'];
header('Content-type: text/html; charset=utf-8');
$username="waynesbo_WHFZen";
$password="whfshop22980";
$database="waynesbo_WHFZen";
$con = mysql_connect(localhost,$username,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$selected = mysql_select_db($database, $con)
or die("Could not select $database");
$SQL = "SELECT FROM products WHERE ID =\"" . $id . "\";";
$result = mysql_query($SQL);
while ($item = mysql_fetch_assoc($result)) {
print $item['ID'] . "<BR>";
print $item['Item_Name'] . "<BR>";
print $item['Item_Desc'] . "<BR>";
print $item['Item_Price'] . "<BR>";
print $item['Item_Shipping'] . "<BR>";
print $item['Item_Image'] . "<BR>";
print $item['Item_Cat'] . "<BR>";
mysql_close($con);
}
print "<form method=POST action=add.php>";
print "<input type=hidden name=action value=add>";
print "<table border=3 width=500>";
print " <tr>";
print " <td colspan=2><p><font size=\"5\" color=\"#000000\"><b>Edit An Item in the Database</b></font></p></td>";
print " </tr>";
print " <tr>";
print " <td>Item Name</td>";
print " <td><input type=text value=$Item_Name name=Item_Name id=txtItem_name size=50 id=\"Item_Name\" onchange=\"checkUniq(this.name, this.value)\"></td>";
print " </tr>";
print " <tr>";
print " <td>Item Description</td>";
print " <td><input type=text name=Item_Desc size=50></td>";
print " </tr>";
print " <tr>";
print " <td>Item Price</td>";
print " <td><input type=text name=Item_Price size=50></td>";
print " </tr>";
print " <tr>";
print " <td colspan=2>Please use the format 'X.XX' with no \$ included for the price.</td>";
print " </tr>";
print " <tr>";
print " <td>Item Shipping</td>";
print " <td><input type=text name=Item_Shipping size=50></td>";
print " </tr>";
print " <tr>";
print " <td>Item Image</td>";
print " <td><input type=text name=Item_Image size=50 value=None></td>";
print " </tr>";
print " <tr>";
print " <td>Item Category</td>";
print " <td><input type=text name=Item_Cat size=50></td>";
print " </tr>";
print " <tr>";
print " <td><input type=submit name=submit value=Submit form></td>";
print " <td><input type=reset></td>";
print " </tr>";
print "</table>";
print "</form>";
?>