Jump to content

connect script to site


Recommended Posts

hello,im trying to connect my website (pvp/pk etc.)to my db..
windows server 2012.local db.

i have open mysql port,i have create new user in db,i have ask from my hosting to add my machine ip to white list..
but after all this the script on site have not make any connect..

anyone have anyidea whats wrong ?
 

Link to comment
Share on other sites

19 minutes ago, Red-Hair-Shanks said:

hello,im trying to connect my website (pvp/pk etc.)to my db..
windows server 2012.local db.

i have open mysql port,i have create new user in db,i have ask from my hosting to add my machine ip to white list..
but after all this the script on site have not make any connect..

anyone have anyidea whats wrong ?
 

Firewall blocks? Try turn it off and check the script again. Or maybe you didn't give access for new DB user to select table's info.

Link to comment
Share on other sites

3 minutes ago, Vilmis said:

Firewall blocks? Try turn it off and check the script again. Or maybe you didn't give access for new DB user to select table's info.

i have tested that is not working,,i have give full acess to user

Just now, baksteen said:

Is there any error code ?

nop 

Link to comment
Share on other sites

canyouseeme.org to verify port open if you are not sure, if you have full priviledged user to have access and its not working print error message from mysql error

2 possibilities:
1) connection refuse by server

2) connection has error in order to connect to server

so you split the problems in what side they are (server or host) first and then you know what fault is.

Link to comment
Share on other sites

18 hours ago, DenArt Designs said:

canyouseeme.org to verify port open if you are not sure, if you have full priviledged user to have access and its not working print error message from mysql error

2 possibilities:
1) connection refuse by server

2) connection has error in order to connect to server

so you split the problems in what side they are (server or host) first and then you know what fault is.

port is open my friend...where i must look for error? 

Link to comment
Share on other sites

<?php
$servername = "server_ip";
$database = "databasename";
$username = "username";
$password = "password";

try
{
    $conn = new PDO("mysql:host=$servername:3306;dbname=$database", $username, $password);
    // set the PDO error mode to exception
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Connected successfully"; 
}
catch(PDOException $e)
{
    echo "Connection failed: " . $e->getMessage();
}
?>

try this and then google the error :)

Link to comment
Share on other sites

17 minutes ago, DenArt Designs said:

<?php
$servername = "server_ip";
$database = "databasename";
$username = "username";
$password = "password";

try
{
    $conn = new PDO("mysql:host=$servername:3306;dbname=$database", $username, $password);
    // set the PDO error mode to exception
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Connected successfully"; 
}
catch(PDOException $e)
{
    echo "Connection failed: " . $e->getMessage();
}
?>

try this and then google the error :)

Connection failed: SQLSTATE[HY000] [2005] Unknown MySQL server host '4564561515' (-2)

Link to comment
Share on other sites

35 minutes ago, DenArt Designs said:

$servername = "server_ip";

add the server's IP address 22.22.22.222

i have add the ip bro..
Connected successfully 

but i dont see the players pvp on the site

Edited by Red-Hair-Shanks
Link to comment
Share on other sites

54 minutes ago, Red-Hair-Shanks said:

i have add the ip bro..
Connected successfully 

but i dont see the players pvp on the site

mysql  port is open ?

Link to comment
Share on other sites

3 minutes ago, MairHost said:

mysql  port is open ?

yes..
i check the code that denart give me..

now when im going to site ..i have this msg down the script Connected successfully

but i dont see any of the chars from my db

 

Success: I can see your service on 22.2.2.2.22 on port (3306)
Your ISP is not blocking port 3306

Edited by Red-Hair-Shanks
Link to comment
Share on other sites

Connection failed: SQLSTATE[HY000] [2005] Unknown MySQL server host '4564561515' (-2)

it says that you have wrong ip added 

you added 4564561515 as IP

Link to comment
Share on other sites

3 minutes ago, DenArt Designs said:

Connection failed: SQLSTATE[HY000] [2005] Unknown MySQL server host '4564561515' (-2)

it says that you have wrong ip added 

you added 4564561515 as IP

i just delete my ip and put deafult ip to post it.....

 

http://prntscr.com/miir4w

Link to comment
Share on other sites

then there is a problem with the script that you use, your database is ok your user is also ok

the script that has the website has problem 

 

Link to comment
Share on other sites

2 minutes ago, DenArt Designs said:

then there is a problem with the script that you use, your database is ok your user is also ok

the script that has the website has problem 

 

<?php

include('config.php');
$top = '10'; //Top Number

mysql_connect($host, $user, $pass);
mysql_select_db($db);

echo "    
    <div class='bar'><div class='place'>#</div><div class='player'>NAME</div><div class='count'>PVP</div></div>
    ";
$i = 1;
$sql = "SELECT char_name, pvpkills FROM characters WHERE accesslevel=0 ORDER BY pvpkills DESC LIMIT $top";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query))
{
    echo
    "
    <div class='bar'>
        <div class='place'>".$i++."</div>
        <div class='player'>".$row['char_name']."</div>
        <div class='count'>".$row['pvpkills']."</div>
    </div>    
    ";
}

echo "

    ";
?>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


  • Posts

    • L2 Insignia High Five 20x MID SERVER FOCUSED ON OLYMPIAD | PVP | AUTOFARM       OPEN BETA TEST SERVER 3 MAY 2024   GRAND OPENING 10 MAY 2024    Rates: 📜 XP/SP 20x | Spoil 15x | Drop 10x | Adena 10x 📜     Server Features: 🔥 No Olf-T Shirt, No big over-enchant, No over-power Donate 🔥 🔥 VIP Gold Color Chat, Unique Olympiad Extra Points Engine, GvG Event 🔥 🔥 Auto-Farm, LoA and DV scheduled PvP Zone, Calendar Daily Reward 🔥 🔥 Castle Instance, Solo Instance, PvP Solo Rift, Dress me system, Adena Boxes 🔥        Website: https://www.l2insignia.com  Discord: https://discord.com/invite/yEgsrHn2hQ      
    • I am selling the essence project which includes versions 388 and 439 that have been running for over 2 years or (447 as custom PVP like Pride). I have a test server for you to test them out. If you are really interested in it then contact my seller at discord: kiwi7106. Price: 4000 Euro P/s: This is a project that I have spent a lot of money and time developing, so if you are not interested in it, please get out of this topic, thank you. P/s 2: If you find the price too expensive, it's best to skip this article and find another project and don't comment negatively on my topic, thank you.
    • Someone ask me for this, it should work on any client that has Kamael race, preview:     Installation - there are two ways to install depending on how you want to use it:   Method 1: If you want to completely replace the original, do:   Copy all lines from your armorgrp to Notepad++, press Ctrl+H, check the "match whole word" option and replace:   kamael.Mkamael_m000_w_ad00   by:   AvengersKamaelWings.Avengers_MKamael_m001_w_ad00   Then replace:   MKamael.Mkamael_m000_t00_w   by:   AvengersKamaelWings.MKamael_m001_t00_w   Now repeat the same process with the female, replace:   kamael.Fkamael_m000_w_ad00   by:   AvengersKamaelWings.Avengers_FKamael_m001_w_ad00   Then replace:   FKamael.Fkamael_m000_t00_w   by:   AvengersKamaelWings.FKamael_m001_t00_w   You're done, paste everything back into File Edit and save!   Method 2: If you only want to replace in specific sets, execute the above process only on the armorgrp of those sets.   Repack by: AvengersTeamBr Password: LadrãoDeFrango      
  • Topics

×
×
  • Create New...