mac-in-the-mountains wrote:
> Can anyone help me figure this one out.
> I have a form which contains two text areas 'start-date'
and 'finish-date'.
> Ideally when filled in with a date (eg 2009-03-16 they
will update the relevant
> records in the database (MySQL 'date' fields).
....
> But when I submit the form I get this message:
>
> 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 '-date='2009-01-30'
> WHERE id=2679' at line 1
>
> I've tried everything I can think of but I can't get it
to work.
Without testing anything out, I think that the problem is the
names of your columns. Having column names with spaces, dashes and
other "special" characters will cause issues, unless you use the
back tick character ( ` ) around your column names in the SQL like
so:
$updateSQL = sprintf("UPDATE dates08 SET `start-date`=%s,
`finish-date`=%s WHERE id=%s",
Of course, a better fix would be to change your column names
to not have special characters in them so you don't have this issue
again.
--
Danilo Celic
|
http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert