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,934 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 3,138 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: Aug 2006
Posts: 15
Reputation: kyleknapp is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
kyleknapp kyleknapp is offline Offline
Newbie Poster

Re: help a newbie? mySQL find & replace

  #4  
Oct 11th, 2006
Okay, I'm still doing something wrong. I created a test php file and called it targetzip.php. it's coded as:

<?php
// Connects to your Database
mysql_connect("localhost", "ID", "PASSWORD") or die(mysql_error());
mysql_select_db("DBNAME") or die(mysql_error());

$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`  =  'on' WHERE  `attributeid`  ='16' AND  `userid` IN (".$ary.")";
mysql_query($update);
} 

?>

When I execute it I get the following error:

Parse error:  syntax error, unexpected T_STRING, expecting '(' in /www/kyleknapp.com/web/targetzip.php on line 8
can you tell what's wrong?

Thanks,
~kyle
Reply With Quote  
All times are GMT -4. The time now is 6:20 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC