pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robby Russell <rrussell@commandprompt.com>
To: pgsql-php@postgresql.org
Cc: Yasmine Kedoo <yazkedoo@hotmail.com>
Subject: Re: UPDATE - Changing Password
Date: Sat, 17 Apr 2004 14:40:24 -0700
Message-ID: <4081A448.4070204@commandprompt.com> (raw)
In-Reply-To: <BAY14-F64cSN00ktmzm00051479@hotmail.com>
References: <BAY14-F64cSN00ktmzm00051479@hotmail.com>

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



view thread (11+ messages)  latest in thread

Message-ID: <4081A448.4070204@commandprompt.com>
Permalink:  ../4081A448.4070204@commandprompt.com/
Also on:    postgresql.org/message-id/4081A448.4070204@commandprompt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: rrussell@commandprompt.com, yazkedoo@hotmail.com
  Subject: Re: UPDATE - Changing Password
  In-Reply-To: <4081A448.4070204@commandprompt.com>
  References: <BAY14-F64cSN00ktmzm00051479@hotmail.com> <4081A448.4070204@commandprompt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox