Re: php update problems

From: "Mike Sears" <msears(at)vianet(dot)ca>
To: "ryan" <ryan(at)bel(dot)bc(dot)ca>
Cc: "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: php update problems
Date: 2000-08-23 00:37:11
Message-ID: 001101c00c9a$46932840$02945bd1@neutrino
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

many thanks both andrew and ryan =)

----- Original Message -----
From: "ryan" <ryan(at)bel(dot)bc(dot)ca>
To: "Mike Sears" <msears(at)vianet(dot)ca>
Cc: "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, August 22, 2000 2:40 PM
Subject: Re: [GENERAL] php update problems

> > Mike Sears wrote:
> >
> > Having a slight problem w/ my postgres database. for some reaons its
> > no longer updating anymore, and for what reason I'm unsure
> >
> > if I'm right then the below "should" update the table I'm working in,
> > though it doesn't. Is ther indeed something wrong here?
> >
> > <?
> > require("dbconect.inc.php");
> >
> > $result = pg_exec($db,
> > "UPDATE news
> > SET date='$date' topic='$topic' body='$body' person='$person'
> > WHERE date='$date2' topic='$topic2' body='$body2' person='$person2'
> > id2='$id';" );
>
> Hi,
>
> Your SQL looks badly formed.
> The brief syntax of UPDATE is:
>
> UPDATE <tablename> SET col1=val1, col2=val2, ..., coln=valn WHERE
> condition1 AND condition2 ;
>
> so basically you're missing 'AND' between each of the where clauses, you
> don't have commas.
>
> If the update returns '0 rows altered' then you know someone else has
> modified the data from under you.
>
> Regards,
> -ryan
>
>
> --
> Ryan Rawson
> System Administrator
> Binary Environments Ltd.
> ryan(at)bel(dot)bc(dot)ca
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Philip Murray 2000-08-23 00:59:19 enum datatype?
Previous Message Mike Sears 2000-08-22 23:50:07 php update problems