php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15615 pg_exec update table sets column to NULL instead of updating it
Submitted: 2002-02-19 04:45 UTC Modified: 2002-02-19 04:48 UTC
From: mercy at edsamail dot com Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 4.1.1 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mercy at edsamail dot com
New email:
PHP Version: OS:

 

 [2002-02-19 04:45 UTC] mercy at edsamail dot com
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  | mercy@edsamail.com
  1 | globedev  | jay@edsamail.com
  1 | globedev  | macky@edsamail.com
  1 | globedev  | paul@edsamail.com
  1 | nirvana   | test@edsamail.com
  1 | metallica | metallica@edsamail.com
  1 | pearl jam | pearl_jam@edsamail.com

PGSQL DATABASE AFTER:
 id |   nick    |         email          
----+-----------+------------------------
  1 | globedev  | mercy@edsamail.com
  1 | globedev  | jay@edsamail.com
  1 | globedev  | macky@edsamail.com
  1 | globedev  | paul@edsamail.com
  1 | nirvana   | test@edsamail.com
  1 | metallica | metallica@edsamail.com
  1 |           | pearl_jam@edsamail.com

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-19 04:48 UTC] derick@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 05 23:01:28 2024 UTC