Jump to content
  • 0

[Help] Need help with script please!


busta
 Share

Question

I know this is probably not the right place to put this topic, but I dont know where to write it, so excuse me. Here is my problem...

My site doesnt work for Hi5 , since the database in sql its l2jls, l2jgs, l2jcs not only l2jdb like before Hi5. This code must be rewriten in order the site to work. Otherwise no Login/Game server online/offline.

code of stats.php :

<?php

 

    $db_user = "root";

    $db_pass = "pass";

    $db_name = "l2jdb";  (<=old style)

    $db_serv = "adress";

 

    $res = mysql_connect ( $db_serv, $db_user, $db_pass ) or die ("Coudn't connect to [$db_serv]");

    $resdb = mysql_select_db ( $db_name, $res );

 

    return $res;

 

?>

 

If someone knows how to fix it please do so!

And NO it doesnt work with changing $db_name = "l2jgs" !!!

Please someone help me!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

you have to declare the 2 or 3 database including the community server.

and to the next codes, complex coding will be need to join the databases query..

 

example

<?php

    $db_user = "root";
    $db_pass = "pass";
    $db_name_gs = "l2jgs";
    $db_name_ls = "l2jls";
    $db_name_cs = "l2jcs";
    $db_serv = "adress";

    $res = mysql_connect ( $db_serv, $db_user, $db_pass ) or die ("Coudn't connect to [$db_serv]");
    $resdb = mysql_select_db ( $db_name_gs, $res ) or die (mysql_error("Cannot connect to Game Server"));
    $resdb = mysql_select_db ( $db_name_ls, $res ) or die (mysql_error("Cannot connect to Login Server"));
    $resdb = mysql_select_db ( $db_name_cs, $res ) or die (mysql_error("Cannot connect to Community Server));

    return $res;

?>

Link to comment
Share on other sites

  • 0

Login/Game doesnt work yet :( prhaps if i show you my other phps you can think of something. The script you was helping with is stats.php

Here are the others:

status.php

<?php
    $server  = "address";
    $portg   = "7777";
    $portl   = "2106";
    $timeout = "1";
?>

status2.php

<?php include "config/status.php" ?>
<?php

    //if ($server && $port && $timeout) {
        $game =  @fsockopen("$server", $portg, $errno, $errstr, $timeout);
        $login =  @fsockopen("$server", $portl, $errno, $errstr, $timeout);
    //}
    if($login) {
        echo "<font size=3><b>Login Server: <font color=#00DF00>Online</font></b></font><br />";
    }
    else {
        echo "<font size=3><b>Login Server: <font color=#FF0000>Offline</font></b></font><br />";
    }
    if($game) {
        echo "<font size=3><b>Game Server: <font color=#00DF00>Online</font></b></font><br />";
    }
    else {
        echo "<font size=3><b>Game Server: <font color=#FF0000>Offline</font></b></font><br />";
    }
    echo "";
?>

 

Link to comment
Share on other sites

  • 0

yes it have, i can connect and create account,my account manager works fine. before when the database was only l2jdb there was no problem with the site, but now with these 3 databases it wont work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disbaled AdBlock