Skip site navigation (1) Skip section navigation (2)

Re: UPDATE - Changing Password

From: Robby Russell <rrussell(at)commandprompt(dot)com>
To: pgsql-php(at)postgresql(dot)org
Cc: Yasmine Kedoo <yazkedoo(at)hotmail(dot)com>
Subject: Re: UPDATE - Changing Password
Date: 2004-04-17 21:40:24
Message-ID: 4081A448.4070204@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-php
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(at)commandprompt(dot)com | Telephone: (503) 667.4564

In response to

pgsql-php by date

Next:From: Robby RussellDate: 2004-04-17 21:57:43
Subject: Re: UPDATE - Changing Password
Previous:From: Yasmine KedooDate: 2004-04-17 21:28:03
Subject: UPDATE - Changing Password

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group