Updating Database Using Form Values

A

Anonymous

Guest
Morning guys.

I'm trying my hand at using the action='$PHP_SELF' update option and running into the problem that the database isn't actually updating.

My query, at the bottom of the page, looks like this:
Code:
// Update Database:
$UpdateDatabase = "UPDATE events SET 

EventTime	    = '" . $_GET["EventTime"] .  "',
EventDate	    = '" . $_GET["EventDate"] .  "',
EventBooked     =	'" . $_GET["EventBooked"] .  "',
EventSpeaker    =	'" . $_GET["EventSpeaker"] .  "'
WHERE EventID   = '" . $_GET["EventID"] .  "'";
$Updated = mysql_query($UpdateDatabase) or die ("Error: " . mysql_error());

Any ideas what I am missing here...?

What I would prefer is to submit the data to another page but as there are multiple forms I'd like the page to open in a new browser window and I don't know if this is possible using a form.
 
Echo your query and see if it looks like you expect. Then paste it into a MySQL client (NOT PHPMyAdmin) and see how many rows it says are affected.
 
Swirlee

Thanks. I revisited the code and guess what...? I'd missed a single quotation...!

Just one little quotation mark has held this up all week...!

Can't see the wood for thr trees mate :-D
 
Back
Top