Page 1 of 1

update statement trouble

Posted: Thu Sep 12, 2002 4:18 am
by Love_Daddy
Hi Guys, me again...

I have a problem with a update statement I'm writing..

$SQL = "update <table> SET
days = $days and used_days = $used
WHERE emp_no = $emp_no"

given that all the variables are numerics

so I get the following error:


Warning: PostgreSQL query failed: ERROR: parser: parse error at or near "" in
/var/www/html/Voffice/process.php on line 17
Connection to Table not established!

whereby line 17 is:
$results=pg_exec($conn,$sql);

Posted: Thu Sep 12, 2002 4:21 am
by twigletmac
Have you tried echoing your SQL statement to make sure that all the variables are getting passed to it properly?

(Oh and database questions belong in the database forum)

Mac

Posted: Thu Sep 12, 2002 4:25 am
by Love_Daddy
Ooops my bad...
I'll remember next time.
Yes, I've echoed my sql and since the values I'm supposed to pass to the database
are coming from another page, so I get the following:
and remember this is the echoed stmnt
UPDATE leave SET leave_days = 0,used_days = 0 WHERE emp_no =

Posted: Thu Sep 12, 2002 4:27 am
by twigletmac
It's probably just a typo but is there no value for $emp_no?

Mac

Posted: Thu Sep 12, 2002 4:42 am
by Love_Daddy
You are right,
The only problem was not the script but the values that I ommitted.

Thanks it's working now..
:P