![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
>>MySQL QUEEERY help yo
Check it out
I got galleries in a table jg_galleries in that table the main domain url is domainA.com Can i so some fancy sql shit to replace doaminA.com with domainB.com in one queeeeery? ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
update table set fieldname="something" where fieldname="something"
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Jun 2004
Posts: 223
|
why not do it after the query, like as you're looping stuff out
$string=str_replace("domainA.com", "domainB.com", "$query_result");
__________________
gfy'ers remind me of the causeheads from pcu |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Omaha Hi/Lo
Join Date: Nov 2003
Posts: 17,380
|
If you go 7-11 today, bring me back some slim jims.
and some pop rocks ![]()
__________________
Trump haters gonna hate. that's all they can do |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Aug 2001
Posts: 1,006
|
update jg_galleries SET fieldyouuseforthedomain="
domainB.com" where fieldyouuseforthedomain="domainA.com";
__________________
Spank me ![]() Dude, where's my traffic? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Jun 2004
Posts: 223
|
or you could do update, i figured that domaina.com was in the db for a reason though
__________________
gfy'ers remind me of the causeheads from pcu |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
cool cool
Let me back up the db then try thanks for the help |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
Quote:
Thats what i said :-)
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Industry Role:
Join Date: Aug 2001
Posts: 1,006
|
Quote:
__________________
Spank me ![]() Dude, where's my traffic? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Mar 2001
Location: Murrieta, CA
Posts: 3,620
|
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(); }
__________________
I buy plugs Skype: Due_Global /Due |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Mar 2001
Location: Murrieta, CA
Posts: 3,620
|
replace { with the opening of character for }
__________________
I buy plugs Skype: Due_Global /Due |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
Quote:
"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 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
So Fucking Banned
Join Date: Aug 2003
Location: San Diego, CA
Posts: 5,464
|
Did you solve this yet? What do the entries look like?
Are they like: http://www.domainA.com/ or more like http://www.domainA.com/gallery1/index.html ? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Industry Role:
Join Date: Mar 2001
Location: Murrieta, CA
Posts: 3,620
|
Quote:
Else "y/gallery/whatever/213423.html" will just be replaced with "x" when it should have been "x/gallery/whatever/213423.html" I asume he have 100's or 1000's of galleries saved on 1 domain that need to be updated to be on another domain.
__________________
I buy plugs Skype: Due_Global /Due |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
So Fucking Banned
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
|
Quote:
http://www.domainA.com/gallery1/index.html |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Confirmed User
Join Date: Jun 2004
Posts: 223
|
Quote:
__________________
gfy'ers remind me of the causeheads from pcu |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Confirmed User
Join Date: May 2004
Posts: 1,167
|
Quote:
UPDATE tablename SET fieldname = REPLACE(fieldname,'domainA','domainB') u gotta study more my man |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 | |
Confirmed User
Industry Role:
Join Date: Mar 2001
Location: Murrieta, CA
Posts: 3,620
|
Quote:
Got nothing to do with if I need to study more or not. ![]() The original search and replace script contained a lot more functions that included updating other tables for some of the results depending on what was returned from the first result. So a simple replace wouldn't be good enough for what I needed it for.
__________________
I buy plugs Skype: Due_Global /Due |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Confirmed User
Join Date: Feb 2004
Location: Toronto-I would rather DIE of thirst, then drink from the cup of MEDIOCRITY!
Posts: 2,055
|
This thread reminds me of this..
asdlfkjasd;lfhspdfhglgpoighgpowigwekjhwoeigjkwe Like Chinese to me. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 | |
Confirmed User
Join Date: May 2004
Posts: 1,167
|
Quote:
j/k ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 | |
Confirmed User
Industry Role:
Join Date: Nov 2003
Location: Olongapo City, Philippines
Posts: 4,618
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 | |
Confirmed User
Join Date: Jun 2004
Posts: 2,049
|
Oh then Sarah, you'll appreciate this actual copy and paste from Perl documents.
Quote:
My favorite! ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |