Neil,

> 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).


Don't echo $ShowID alone, ECHO both of the apparently pertinent values - and within 
some sort of 'delimiters' so
that you can check for leading/trailing spaces etc.
Mostly people would put the query into a PHP variable called $sql. You use that name 
for a MySQL resource.
Possible confusion/hesitation of comprehension?
Try splitting the query formation and the call into two PHP statements.
ECHO the query in all its glory, before making the call.

Please confirm tradeshows tbl definition (startdate and enddate in particular).

What is PEBKAC? (I (in)famously use POBCAK)

Please advise,
=dn



---------------------------------------------------------------------
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