WM
|
| Posted: 04/06/2003, 6:59 AM |
|
Hi,
I'm trying to insert code that will put a date in a field called "canceldate" in a table called "member" I used this code in the after update custom code area:
$SQL = "UPDATE member SET canceldate = DATE_ADD(NOW(), INTERVAL 1 MONTH)
WHERE memberid=(ccGetUserid(), ccInteger);
$db= new clsDBConnection1();
$db->Query($SQL);
unset ($db);
I'm getting this error message:
Database error: Invalid SQL: UPDATE member SET WHERE memberid = 24
MySQL Error: 1064 (You have an error in your SQL syntax near 'WHERE memberid = 24' at line 1)
Session halted.
I am using mySQL, PHP, and CCS2.
What am I doing wrong that the SET part of the SQL isn't being read? Is there an easier way of doing this?
Thanks for your help
|
|
|
 |
RonB
|
| Posted: 04/07/2003, 6:12 AM |
|
$SQL = "UPDATE member SET canceldate = DATE_ADD(NOW(), INTERVAL 1 MONTH)
WHERE memberid=" .CCToSQL(CCGetUserID(), ccsInteger);
$db= new clsDBConnection1();
$db->query($SQL);
unset ($db);
Ron
|
|
|
 |
WM
|
| Posted: 04/08/2003, 10:52 AM |
|
Thanks RonB!
|
|
|
 |
|