X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 64AA5D1D099 for ; Sat, 17 Apr 2004 18:40:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 35659-08 for ; Sat, 17 Apr 2004 18:40:33 -0300 (ADT) Received: from hosting.commandprompt.com (128.commandprompt.com [207.173.200.128]) by svr1.postgresql.org (Postfix) with ESMTP id 97640D1E123 for ; Sat, 17 Apr 2004 18:40:30 -0300 (ADT) Received: from commandprompt.com (dsl093-038-087.pdx1.dsl.speakeasy.net [66.93.38.87]) (authenticated) by hosting.commandprompt.com (8.11.6/8.11.6) with ESMTP id i3HLeXu17563; Sat, 17 Apr 2004 14:40:33 -0700 Message-ID: <4081A448.4070204@commandprompt.com> Date: Sat, 17 Apr 2004 14:40:24 -0700 From: Robby Russell Organization: Command Prompt, Inc. User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-php@postgresql.org Cc: Yasmine Kedoo Subject: Re: UPDATE - Changing Password References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/22 X-Sequence-Number: 2679 Yasmine Kedoo typed this on 04/17/2004 02:28 PM: > Hi. > > Does anyone know how to use UPDATE with PHP for changing a password? > I've tried the following code: > > $query = "UPDATE patperinfo SET trim(password)='$newpw' WHERE > trim(gpid)='$gpidno'"; > $result = pg_exec($database, $query); > > where new $newpw & $gpidno are the values entered into a form then > passed to the script. > > I get the following error: > > Warning: PostgreSQL query failed: ERROR: parser: parse error at or near > "(" at character 27 in /home/webpages/yamkedoo/Tests/chpw1.php on line 48 > > where the error is on the line: $result = pg_exec($database, $query); > > $query = "UPDATE tablename SET password = '$newpw' WHERE ... I don't know why you'd trim a fieldname while setting it. -Robby -- Robby Russell, | Sr. Administrator / Lead Programmer Command Prompt, Inc. | http://www.commandprompt.com rrussell@commandprompt.com | Telephone: (503) 667.4564