User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 373,936 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,802 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:

help a newbie? mySQL find & replace

Join Date: Sep 2006
Location: NYC
Posts: 133
Reputation: sn4rf3r is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
sn4rf3r's Avatar
sn4rf3r sn4rf3r is offline Offline
Junior Poster

Re: help a newbie? mySQL find & replace

  #2  
Oct 11th, 2006
Take this:
Originally Posted by kyleknapp View Post
SELECT * FROM `phplist_user_user_attribute` WHERE `attributeid`= 7 AND `value`= "68104"

and make a comma separated list od the id's which you want to update
[php]
$sql = 'SELECT id FROM `phplist_user_user_attribute` WHERE `attributeid`= 7 AND `value`= "68104"';
$query = mysql_query($sql);
if mysql_num_rows($query) {
$ary = implode(',', mysql_fetch_assoc($query, MYSQL_NUM));
$update = "UPDATE `phplist_user_user_attribute` SET `value` = '' WHERE `attributeid` ='16' AND `userid` IN (".$ary.")";
mysql_query($update);
}
[/php]
hope this helps.
Reply With Quote  
All times are GMT -4. The time now is 6:29 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC