Print
Close
SQL Query help required
Printed from:
Snitz™ Forums 2000
URL:
https://forum.snitz.com/forumTopic/Posts/69187?pagenum=1
Printed on:
05 November 2025, 11:10
Topic
Author :
Webbo
Subject :
SQL Query help required
Posted :
17 February 2010, 17:59
Message :
I want to update a range of products within a MySql database using phpMyAdmin
The SQL Query I'm using is:
UPDATE `products` SET `manufacturers_id` = '1' WHERE `products`.`products_id` = 3 LIMIT 1;
What I'd like to do is place a range in place of '3' in 'products.products_id'=
So that I can update a range of ID's at once instead of doing them all individually. Can someone please show me how?
Thanks
Replies ...
1
Reply Author:
Shaggy
Replied on:
18 February 2010, 05:48
Message:
One solution is to use the
IN
operator and provide a comma separated list of the record you wish to update:
Code:
UPDATE
TABLE
SET
FIELD1
='
value
' WHERE
FIELD2
IN (
comma
,
separated
,
list
,
of
,
values
)
2
Reply Author:
Webbo
Replied on:
19 February 2010, 17:53
Message:
Thanks Shaggy, worked a treat :)
3
Reply Author:
Shaggy
Replied on:
22 February 2010, 05:12
Message:
You're welcome, Webbo
© 2000-2021 Snitz™ Communications