Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Insert data into another DB

Asked Modified Viewed 4,492 times
L
Lippke
L
Lippke 10
- Lippke
  • Member, joined since
  • Contributed 168 posts on the community forums.
  • Started 35 threads in the forums
  • Started this discussions
asked
Member

Hallo all

I need to connect to a other database than the one my php-fusion is saved for an infusion i am making for a friend by need help.

Is it possible to connect to another database to save some data ?

if yes, could someone tell me how, or make an example.

Have tried using this dbconnect and it don't seem to work

here are what i have tried:

add_to_database_test.php

<?php
require_once "../../../maincore.php";
require_once INFUSIONS."dayz_whitelist/config_dayzdb.php";

if (!checkrights("DAZW") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../../index.php"); }   


$testlink = dbconnect($db_host_test, $db_user_test, $db_pass_test, $db_name_test);
      unset($db_host_test, $db_user_test, $db_pass_test);

      
   $result = dbquery("INSERT INTO test (id, test) VALUES ('', '55')");
      
?>


config_dayzdb.php

<?php
// database settings
$db_host_test = "mysql1099.servage.net";
$db_user_test = "testuser";
$db_pass_test = "********";
$db_name_test = "testdb";
?>
0 replies

6 posts

J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

Most hosting companies don't allow external/remote connection to MySQL, check this thing 1st.
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

Actually, Servage does, but you need to create a new database dedicated for that.

Quote

From Servage Wiki
How can I remote MySQL database?

We allow from all newest clusters to select a remotable MySQL database. Please note, the server can be accessed from remote clients. We recommend the normal MySQL v5 instead as it is more reliable and provides better performance.

You can access your databases in your admin controlpanel "MySQL > Databases" select the Databasename to view your Database in phpMyAdmin.


I have not done it so I can not help you, just saying it is possible.
Homdax attached the following file:
scr11-03-2013_202802.png [No information available / 63 Downloads]
0 replies
K
KasteR
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
answered
Senior Member

You'll need to ensure that the server has port 3306 open, and the user accessing has FULL privileges/rights (%).

I'd adhere to JoiNNN's advice though. Not sure why you're wanting to do this. But it would pose a risk (opening additional port). Also as he mentioned, most providers would disallow this, simply for that reason. It may abuse a free service(s) terms (depending on host rules/allowances).
0 replies
L
Lippke
L
Lippke 10
- Lippke
  • Member, joined since
  • Contributed 168 posts on the community forums.
  • Started 35 threads in the forums
  • Started this discussions
answered
Member

Quote

JoiNNN wrote:

Most hosting companies don't allow external/remote connection to MySQL, check this thing 1st.


Thanks, as Richard says they do and yes i have made that database to test with :)
Have written to them and they say that there are nothing wrong


But if you look at my script. will you say i should work or not ?

Merged on Mar 15 2013 at 16:07:49:
Okay now i work, weird :o
again thanks to all for there help
Edited by Lippke on 15-03-2013 16:07,
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

;)
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

If the Database is on the same server, then you may use mysql_select_db to switch between databases.

Otherwise, you may try opening a new link to database. Read here how to open new link: http://php.net/manual/en/function.mys...onnect.php

Good luck!
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 6 posts
  • Votes 0 votes
  • Topic users 5 members

5 participants

H
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
L
L
Lippke 10
- Lippke
  • Member, joined since
  • Contributed 168 posts on the community forums.
  • Started 35 threads in the forums
  • Started this discussions
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
J
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
K
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet