You can't perform update like this.
You should loop through rows you want to update if they have different key
values.

UPDATE tbl_ib_articles SET col_name=new_value WHERE key_column=key_value;

You can change the condition part, which can include non-key columns,

HTH,
Mustafa



----- Original Message -----
From: "Charles Kline" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 5:56 AM
Subject: Re: [PHP-DB] INSERT Question


Everything looks okay with this when I echo the sql string:

INSERT INTO tbl_ib_articles (issue_brief,article) VALUES
('24','30'),('24','20'),('24','31')

My question was, what do I need to change to make this an UPDATE?

Thanks,
Charles

On Monday, March 31, 2003, at 08:30 PM, [EMAIL PROTECTED] wrote:

> In a message dated 3/31/2003 5:26:36 PM Pacific Standard Time,
> [EMAIL PROTECTED] writes:
>
>
> > then I built the INSERT like so:
> > foreach($article_keys as $articleid)
> > {
> > $insert[] = "('$v_ib_id','$articleid')";
> > }
> > $article_sql = "INSERT INTO tbl_ib_articles (issue_brief,article)
> > VALUES " . implode(',',$insert);
>
>
>
> It's pretty much okay, except you don't have ( ) around the string
> that you create with the implode. You can echo $article_sql to see
> exactly what the SQL looks like and you can then modify your statement
> so you get the right SQL.
>
> Janet


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to