Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
In my form I have a dropdown box, in which the user will select an option and that option will be deleted from the table. I also have a something similar setup for editing one of the options. I think I'm having trouble with my SQL code. Thanks for looking!Code: Select all
case "edit":
$tempCat = stripslashes($_POST['eBox']);
echo "$tempCat<br>";
//this statement runs but I don't think it's pulling the id
$currentCat = mysql_query("SELECT `genreId` FROM `genre` WHERE `desc`='$tempCat'")
or die(mysql_error());
echo "$currentCat<br>";
//editCat is a textfield where the user can make their change to the item in the dropdown
$eCat = stripslashes($_POST['editCat']);
$result = mysql_query("UPDATE `genre` SET desc='$eCat' WHERE genreID='$currentCat'")
or die("edit statement error<br>");
echo "$result";
break;
case "delete":
$tempCat = stripslashes($_POST['dBox']);
echo "$tempCat";
$result = mysql_query("DELETE FROM genre WHERE desc='$tempCat'")
or die("delete statement error<br>");
echo "$result";
break;*selected option from dropdown*
Resource id #3
edit statement error
If I run the delete I get:
*selected option from dropdown*
edit statement error
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]