Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 30th, 2003, 11:33 PM
Dasher Dasher is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Oakdale, MN USA
Posts: 94 Dasher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Will threaded query work?

Will this basic concept work?
php Code:
Original - php Code
  1.  
  2. $Query "SELECT Some_Data, More_Data, Data1 FROM My_Table WHERE Some_Value=1";
  3.  
  4. $result = mysql_query($Query,$link) or die ("blah blah");
  5.  
  6. while ($a_row = mysql_fetch_array($result) )
  7.  
  8.     {
  9.     UPDATE Another_table SET Some_Data=$a_row[Some_Data],More_Data=$a_row[More_Data] WHERE Data1=$a_row[Data1];
  10.     }


Basically trying to transfer some data from one table to another.

Thanks


Reply With Quote
  #2  
Old November 30th, 2003, 11:51 PM
Dasher Dasher is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Oakdale, MN USA
Posts: 94 Dasher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Oops...

It should read more like this...

php Code:
Original - php Code
  1.  
  2. $Query "SELECT Some_Data, More_Data, Data1 FROM My_Table WHERE Some_Value=1";
  3.  
  4. $result = mysql_query($Query,$link) or die ("blah blah");
  5.  
  6. while ($a_row = mysql_fetch_array($result) )
  7.  
  8.     {
  9.     $Query="UPDATE Another_table SET Some_Data=$a_row[Some_Data],More_Data=$a_row[More_Data] WHERE Data1=$a_row[Data1]";
  10.     $result2 = mysql_query($Query,$link) or die ("blah blah");
  11.     }
  12.  


And Data1 would be a record_ID

Reply With Quote
  #3  
Old December 1st, 2003, 12:18 AM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Will threaded query work?

your concept is right on!

Reply With Quote
  #4  
Old December 1st, 2003, 01:23 AM
Dasher Dasher is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Oakdale, MN USA
Posts: 94 Dasher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Will threaded query work?

I was a little worried about doing an update that way, but it worked ... Thanks for confirming the concept. I was sort of expecting a blow up :-)

That makes life a little easier.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Will threaded query work?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway