From: [EMAIL PROTECTED]
Operating system: Linux
PHP version: 4.1.1
PHP Bug Type: PostgreSQL related
Bug description: pg_exec update table sets column to NULL instead of updating it
im using PHP-WML and i was trying to update a table in postgres with this:
<?
function edit($id,$nick,$new_nick) {
$sql = "UPDATE address_book SET nick='$new_nick' WHERE id=$id AND
nick='$nick'";
$update = pg_exec($sql);
echo("$sql");
}
?>
OUTPUT ON SCREEN:
UPDATE address_book SET nick='STP' WHERE id=1 AND nick='pearl jam'
PGSQL DATABASE BEFORE:
id | nick | email
----+-----------+------------------------
1 | globedev | [EMAIL PROTECTED]
1 | globedev | [EMAIL PROTECTED]
1 | globedev | [EMAIL PROTECTED]
1 | globedev | [EMAIL PROTECTED]
1 | nirvana | [EMAIL PROTECTED]
1 | metallica | [EMAIL PROTECTED]
1 | pearl jam | [EMAIL PROTECTED]
PGSQL DATABASE AFTER:
id | nick | email
----+-----------+------------------------
1 | globedev | [EMAIL PROTECTED]
1 | globedev | [EMAIL PROTECTED]
1 | globedev | [EMAIL PROTECTED]
1 | globedev | [EMAIL PROTECTED]
1 | nirvana | [EMAIL PROTECTED]
1 | metallica | [EMAIL PROTECTED]
1 | | [EMAIL PROTECTED]
--
Edit bug report at http://bugs.php.net/?id=15615&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=15615&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=15615&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=15615&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=15615&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15615&r=support
Expected behavior: http://bugs.php.net/fix.php?id=15615&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=15615&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=15615&r=submittedtwice