Jump to content

SQL not updating, Im sure its a simple mistake


perezf

Recommended Posts

Im sure im making a simple mistake can someone tell me why this code will not update my SQL, it shos the message that it completed but it never changes

 

SQL Statement below:

 

if($Submit == "Save"){
$titleedit = $_POST['titleedit'];
$lengthedit = $_POST['lengthedit'];
$priceedit = $_POST['priceedit'];
$descedit = $_POST['descedit'];
$theedit = $_POST['theedit'];
$sql = "UPDATE excursions SET exc_title='$titleedit', exc_length='$lengthedit', exc_price='$priceedit', exc_desc='$descedit' WHERE exc_id='48'";
mysql_query("$sql") or die(mysql_error());
echo "Excursion Updated<br><br>";
}

Yes and it also does not give me an error message, it shows that it executed

hmmmmmm

i even tried removing the single quotes didnt work

if($Submit == "Save"){
$titleedit = $_POST['titleedit'];
$lengthedit = $_POST['lengthedit'];
$priceedit = $_POST['priceedit'];
$descedit = $_POST['descedit'];
$theedit = $_POST['theedit'];
$sql = "UPDATE excursions SET exc_title='$titleedit', exc_length='$lengthedit', exc_price='$priceedit', exc_desc='$descedit' WHERE exc_id=$theedit";
mysql_query("$sql") or die(mysql_error());
echo "Excursion Updated<br><br>";
}

apologize if i am wrong, can you just echo the post values i.e,

 

echo "$titleedit - $lengthedit ..... the rest of post values and specially don't forget $theedit";

can you please tell me if it prints the post values.  i will wait for your confirmation and lets solve this issues now?

 

 

Do remember to comment the update statement for time being.

/*$sql = "UPDATE excursions SET exc_title='$titleedit', exc_length='$lengthedit', exc_price='$priceedit', exc_desc='$descedit' WHERE exc_id=$theedit";

mysql_query("$sql") or die(mysql_error());

echo "Excursion Updated<br><br>";*/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.