Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Submit one form and duplicate infos in two databases
Old 01-07-2006, 10:17 AM Submit one form and duplicate infos in two databases
dealgates's Avatar
Novice Talker

Posts: 12
Trades: 0
Hello,

I am looking after a solution in order to submit one register form and duplicate informations in an other database...

I tried something like that but it doesn t work correctly :

// Open the connection to the primary db
$res1 = mysql_connect($host1, $user1, $pass1);
mysql_select_db($db1);

// Open connection to the license server
$res2 = mysql_connect($host2, $user2, $pass2);
mysql_select_db($db2, $res2);

// Pull license data and close when done
mysql_query($check_sql, $res2);
...
mysql_close($res2);

// Now pull content from the primary db
// Not specifying the resource should default to the last open db
mysql_query($query);

Turns out this last query, since it cant find an active connection, will try to connect with mysql_connect() with no paramaters.

It seems that is not possible to do it with mysql_close()

Maybe somebody have a solution for a such trick

Happy New Year !!!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
dealgates is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-07-2006, 01:30 PM
Ultra Talker

Posts: 264
Location: UK
Trades: 3
After you connect to the database you need to use an INSERT command to add the details to that database.

If you want to add to two databases you simply repeat the process, connect then insert.
uktvindex is offline
Reply With Quote
View Public Profile
 
Old 01-07-2006, 02:11 PM
dealgates's Avatar
Novice Talker

Posts: 12
Trades: 0
the problem is that i can connect to the 1 first database and the second but after the second connection, i can t connect to the first back
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
dealgates is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Submit one form and duplicate infos in two databases
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11704 seconds with 12 queries