Jump to content

UPDATE help


ShaolinF

Recommended Posts

Hey guys,

 

I have 1 records in a table called events with 3 coloumns called eventName, ticketAmount and ticketPrice. I am trying to UPDATE this table with the following statement but it is not working:

 

//UPDATE Data
$result = mysql_query("UPDATE event SET eventName = $_POST['eventnm'], ticketAmount = $_POST['tickno'], ticketAmount = $_POST['tickprice']");

Link to comment
https://forums.phpfreaks.com/topic/87331-update-help/
Share on other sites

I run the code and I get the following:

 

Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' ticketAmount = 122, ticketPrice = 1.22' at line 1 Whole query:

 

//Error Check
if (!$result) {
    $message  = 'Invalid query: ' . mysql_error() . "\n";
    $message .= 'Whole query: ' . $result;
    die($message);
}

Link to comment
https://forums.phpfreaks.com/topic/87331-update-help/#findComment-446682
Share on other sites

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.