MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community 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 February 9th, 2003, 05:56 PM
john28uk john28uk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 13 john28uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
read one mysql,write to another

Hi

I am pretty useless when it comes to writing php, so can anybody point me in the direction of a script that will read one database and take for example username and password, then when the user clicks continue write the username and password to a second database.

The reason i would want this is for a site that has a login using one database and a online game using another database, it seems to be bugging the users having to sign up twice.

Thanks

John

Reply With Quote
  #2  
Old February 12th, 2003, 06:02 PM
DDDooGGG DDDooGGG is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Melbourne, Australia
Posts: 97 DDDooGGG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 33 sec
Reputation Power: 6
Try doing a search in Google.com for MySQL-Front, i think thats what you want.
__________________
regards,


Fulton

Reply With Quote
  #3  
Old February 12th, 2003, 06:27 PM
john28uk john28uk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 13 john28uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Fulton

Thanks for the reply but unfortunately you may have misunderstood me, what I need is a php script that will read one database, and write to another. This needs to be done without any input from me the admin, all automated online in a script so that the users of my site only have to enter one set of details.

Thanks anyway

John

Reply With Quote
  #4  
Old February 12th, 2003, 09:16 PM
DDDooGGG DDDooGGG is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Melbourne, Australia
Posts: 97 DDDooGGG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 33 sec
Reputation Power: 6
just write a script the SELECTS the data from 1 database and then put those variable into the other database using the INSERT command.
Is that what you mean?

Reply With Quote
  #5  
Old February 13th, 2003, 03:14 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
I think i get what you mean, alternatively you could make your signup script insert into both databases.
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
  #6  
Old February 13th, 2003, 11:55 AM
john28uk john28uk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 13 john28uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by DDDooGGG
just write a script the SELECTS the data from 1 database and then put those variable into the other database using the INSERT command.
Is that what you mean?


Yes that is exactly what i mean, but i cannot do it, I am new to PHP and i am having difficulty getting to grips with it. So any help would be more than useful.

Thanks John
John

Reply With Quote
  #7  
Old February 13th, 2003, 01:15 PM
CHornJr's Avatar
CHornJr CHornJr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: New York City
Posts: 233 CHornJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 50 m 19 sec
Reputation Power: 6
Send a message via AIM to CHornJr Send a message via MSN to CHornJr Send a message via Yahoo to CHornJr
I don't know if your using sessions or cokkies but you can have the two site look for the same sessions(or cookie). I thinkt hat should od it.
__________________
CHornJr
"One day I'll know what I am doing"
My Blog
Suanhacky Lodge #49
Rebel Squadrons

Reply With Quote
  #8  
Old February 13th, 2003, 05:21 PM
DDDooGGG DDDooGGG is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Melbourne, Australia
Posts: 97 DDDooGGG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 m 33 sec
Reputation Power: 6
You need something like this:
PHP Code:
 $db mysql_connect("localhost""""");
mysql_select_db("database",$db);
$result mysql_query("SELECT * FROM table WHERE id = 1"$db);    
while(
$row mysql_fetch_array($result))
{
 
$value1 $row['column_name'];
 
$value2 $row['column_name1'];
 
$value3 $row['column_name2'];
}

$db2 mysql_connect("lremotehost""""");
mysql_select_db("database",$db2);
mysql_query("insert into vew table values (0,$value1 ,$value2, $value3 )"$db2); 

but if you want to do multiple records, you will need to create an array, you can look at this thread for ideas.http://www.devarticles.com/forum/sh...72&goto=newpost

hope this helps a bit

Reply With Quote
  #9  
Old February 15th, 2003, 11:34 AM
john28uk john28uk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 13 john28uk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Many thanks

Thanks for that, i will give it a go

John

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > read one mysql,write to another


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 6 hosted by Hostway