I appear to be having an error with the following update that I am
submitting to my database. I am using mysql's DATE_FORMAT function to pull
the date out and insert in a user friendly form. Upon submission of the
modified data, I use the below SQL to update the table information.

Everything is running fine when I leave out the $ShowStart and $ShowEnd out
of the equation, but when I add it back in, instead of updating the existing
entry in the database, it adds in a new entry.

$ShowStart = ("$StartYear-$StartMonth-$StartDay");
$ShowEnd = ("$EndYear-$EndMonth-$EndDay");

$sql = mysql_query ("UPDATE tradeshows SET
                        showname = \"$ShowName\",
                        city = \"$ShowCity\",
                        country = \"$ShowCountry\",
                        startdate = \"$ShowStart\",
                        enddate = \"$ShowEnd\",
                        booth = \"$BoothNumber\",
                        boothsize = \"$BoothSize\",
                        ondisplay = \"$OnDisplay\",
                        attendees = \"$Attendees\" 
                        WHERE ID = \"$ShowID\" ");

The $ShowID variable is definitely correct, as I decided to echo it back to
the browser so I could double check my PHP. I know that it is much better to
use the UNIX time stamp to reformat dates, but I still do not understand
what I could be doing wrong.
has anyone come across this before?

The MySQL version I am using is 3.23.39 (hmm. maybe I should upgrade this to
start with).

Cheers.
Neil Silvester

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to