I'm trying to write an update query in PHP using progres..
$sql="UPDATE users SET
name='$name',
surname='$surname',
tel_no='$telno',
cel_no=$celno
WHERE emp_no=$empno";
$results=pg_exec($connection,$sql);
But it doesn't work.
What would be a problem?
I get this msg:
Warning: PostgreSQL query failed: ERROR: parser:
parse error at or near "" in /var/www/html/shakanet/update.php on line 20
Connection to Table not established!
Of which line 20 is:
$results=pg_exec($connection,$sql);
Have you tried echo'ing out $sql before passing it to pg_exec to make sure its the right query? Have you established the connection with pg_connect/pg_pconnect at some point in your program?
If i don't remember wrong postgres behaves a bit odd with single- and double quotes (' and "). Try to change your ' into " and see if it still complaints.