CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Need help with custom UPDATE SQL

Print topic Send  topic

Author Message
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!

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.