Here is the whole code…
[php]<?PHP
$reqlevel = 0;
include(“config.php”);
include(“members/membersonly.inc.php”);
$invID = $_POST[‘invIDH’];
$invID2 = $_POST[‘editItem1’];
if ($submit == “Delete Item”) {
$query = “DELETE from inventory where invID=’”.$invID."’";
$result = mysql_query($query);
}
elseif ($submit == “Edit Item”) {
$sql = (“SELECT * FROM inventory WHERE title = ‘{$_POST[‘selection’]}’”);
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
echo “
Title | |
Price | |
Year | |
Make | |
Model | |
Miles | |
Interior Color | |
Exterior Color | |
Description | $myrow[9] |
|
echo “
”;
}
elseif ($submit == “Modify Item”) {
$sql = (“SELECT * FROM inventory WHERE invid = ‘$_POST[invIDH]’”);
$result = mysql_query($sql);
if (!$result) {
error(‘A database error occured in processing your submission.\nIf this error perists, please contact webmaster@***.com.’);
}
$result = mysql_query(“UPDATE inventory SET title = ‘$_POST[title]’, miles = ‘$_POST[miles]’, price = ‘$_POST[price]’, year = ‘$_POST[year]’, make = ‘$_POST[make]’, model = ‘$_POST[model]’, incolor = ‘$_POST[incolor]’, excolor = ‘$_POST[excolor]’, description = ‘$_POST[description]’ WHERE invID = ‘$_POST[invIDH]’”) or die(mysql_error());
if (!$result) {
error(‘A database error occured in the processing your submission.\nIf this error persists, please contact webmaster@***.com.’);
}
}
?>
?>
</select>
<?PHP // get the current news items $query = "Select * from inventory ORDER BY 'postDate' DESC"; $result = mysql_query($query); while($row = mysql_fetch_array($result)){ ?>
THe problem im having is with this code right here…
[php]
elseif ($submit == “Modify Item”) {
$sql = (“SELECT * FROM inventory WHERE invid = ‘$_POST[invIDH]’”);
$result = mysql_query($sql);
if (!$result) {
error(‘A database error occured in processing your submission.\nIf this error perists, please contact webmaster@***.com.’);
}
$result = mysql_query(“UPDATE inventory SET title = ‘$_POST[title]’, miles = ‘$_POST[miles]’, price = ‘$_POST[price]’, year = ‘$_POST[year]’, make = ‘$_POST[make]’, model = ‘$_POST[model]’, incolor = ‘$_POST[incolor]’, excolor = ‘$_POST[excolor]’, description = ‘$_POST[description]’ WHERE invID = ‘$_POST[invIDH]’”) or die(mysql_error());
if (!$result) {
error(‘A database error occured in the processing your submission.\nIf this error persists, please contact webmaster@***.com.’);
}
}
[/php]
Every time i click the Modify item button it turns the seleceted database to all blank lines, just for the item im modifying all others stay the same… Im just trying to get it to update from the text fields that i have on the form, any help or suggestions would be lovely… =o thx