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>";
}

Link to comment
Share on other sites

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>";
}

Link to comment
Share on other sites

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>";*/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.