View Single Post
Old 07-16-2004, 11:58 AM  
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Quote:
Originally posted by Due
This might be what you are looking for:

$searching="FIND-THIS";
$replace="REPLACE-WITH-THIS";

$res = mysql_query("SELECT * FROM jg_galleries WHERE url LIKE '%$searching%'");
while($row = mysql_fetch_array($res)) {
$surl++;
$my_id[$surl] = $row[id];
$my_thumb[$surl] = $row[url];
}

while($y<$surl){
$y++;
$newurl[$y]=str_replace("$searching", "$replace", $my_thumb[$y]);
$query = mysql_query("UPDATE jg_galleries SET url='$newurl[$y]' WHERE id='$my_id[$y]'") or print mysql_error();
}
there is NO reason at all to do this, when a simple
"UPDATE x SET y WHERE z" query will do just as well...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote