Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server
You last visited: Today at 00:05

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



PDO Access when not Local

Discussion on PDO Access when not Local within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old   #1
 
mindlessx's Avatar
 
elite*gold: 0
Join Date: Jun 2018
Posts: 20
Received Thanks: 0
PDO Access when not Local

Hey I'm trying to setup a simple Website to create Accounts on my Server, but i can't connect to database.

Code:
$conn = new PDO("sqlsrv:server=$host;database=$acc;ConnectionPooling=0",$user,$pass);
$host="XXXXXXX\SQLEXPRESS"
But what if its not local? is there sth like "ip:XXXXXXX\SQLEXPRESS"
mindlessx is offline  
Old 06/27/2018, 06:38   #2
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,223
Received Thanks: 1,482
Quote:
Originally Posted by mindlessx View Post
Hey I'm trying to setup a simple Website to create Accounts on my Server, but i can't connect to database.

Code:
$conn = new PDO("sqlsrv:server=$host;database=$acc;ConnectionPooling=0",$user,$pass);
$host="XXXXXXX\SQLEXPRESS"
But what if its not local? is there sth like "ip:XXXXXXX\SQLEXPRESS"
example
$host = "VALTYR-PC\SQLEXPRESS"; //SQL Host name
$user = "sa"; //SQL server username
$password = "YouTubeValtyr"; //SQL Server password
$dbs = array(
'ACC'=>"SRO_VT_ACCOUNT",
'SHARD'=>"SRO_VT_SHARD",
'LOG'=>"SRO_VT_SHARDLOG",
'WEB'=>"SRO_VT_VALTYR"); //Databases

Quote:
Originally Posted by mindlessx View Post
But what if its not local? is there sth like "ip:XXXXXXX\SQLEXPRESS"
yes you can add via IP

open the port in SQL Server Configuration Manager
Click down SQL Server Network Configuration
click on Protocols for SQLEXPRESS and than Enable TCP/IP
after this double klick left and IP Addresses
Scroll down IPAll add in TCP Dynamic Port 1443
and done
Dont forget Restart SQL Server
and done

if you want to add via via sql host use your ip with port 1443 dont forget after your IP ,1443

example $host="127.0.0.1,1443"
NorseGodTyr is offline  
Thanks
1 User
Old 06/27/2018, 17:40   #3
 
mindlessx's Avatar
 
elite*gold: 0
Join Date: Jun 2018
Posts: 20
Received Thanks: 0
Quote:
Originally Posted by mialuisa View Post
example
$host = "VALTYR-PC\SQLEXPRESS"; //SQL Host name
$user = "sa"; //SQL server username
$password = "YouTubeValtyr"; //SQL Server password
$dbs = array(
'ACC'=>"SRO_VT_ACCOUNT",
'SHARD'=>"SRO_VT_SHARD",
'LOG'=>"SRO_VT_SHARDLOG",
'WEB'=>"SRO_VT_VALTYR"); //Databases



yes you can add via IP

open the port in SQL Server Configuration Manager
Click down SQL Server Network Configuration
click on Protocols for SQLEXPRESS and than Enable TCP/IP
after this double klick left and IP Addresses
Scroll down IPAll add in TCP Dynamic Port 1443
and done
Dont forget Restart SQL Server
and done

if you want to add via via sql host use your ip with port 1443 dont forget after your IP ,1443

example $host="127.0.0.1,1443"
I did exactly what you said, but i still can't connect.
Already did this a few days ago.

THC/IP at Protocols for SQLEXPRESS is already activated. Used another port for dynamic, but changed it to 1443 too.

Is there maybe another solution?
Thanks.

--------------------

Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /xxxxxxxxxxxxxxxxxxxxxxx/sql.php:13 Stack trace: #0

#push

Port is open (checked) ✓
SQL Server is Running ✓
Password & Username are right ✓

Don't know what to do..
Thats the full connecting code (PDO)..

PHP Code:
<?php
$dbhost
="XX.XXX.XX.XXX,1443";
$dbname="SRO_VT_ACCOUNT";
$dbusername="sa";
$dbpassword="XXXXXXXXXXXXXXXX";


$link = new PDO("mysql:host=$dbhost;dbname=$dbname"$dbusername$dbpassword);
$statement $link->prepare("INSERT INTO dbo.TB_User(StrUserID, password, sec_primary, sec_content)
    VALUES(:name, :pass, :sec_p, :sec_c)"
);
$statement->execute(array(
    
"name" => "testname",
    
"pass" => "e22a63fb76874c99488435f26b117e37",
    
"sec_p" =>  3,
    
"sec_c" =>  3
));

?>
I always get error code 500 and don't know what to do.. the SQL Port shall be open ( Proofed)..
Please Help
mindlessx is offline  
Old 06/28/2018, 16:49   #4
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,223
Received Thanks: 1,482
Quote:
Originally Posted by mindlessx View Post
I did exactly what you said, but i still can't connect.
Already did this a few days ago.

THC/IP at Protocols for SQLEXPRESS is already activated. Used another port for dynamic, but changed it to 1443 too.

Is there maybe another solution?
Thanks.

--------------------

Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /xxxxxxxxxxxxxxxxxxxxxxx/sql.php:13 Stack trace: #0

#push

Port is open (checked) ✓
SQL Server is Running ✓
Password & Username are right ✓

Don't know what to do..
Thats the full connecting code (PDO)..

PHP Code:
<?php
$dbhost
="XX.XXX.XX.XXX,1443";
$dbname="SRO_VT_ACCOUNT";
$dbusername="sa";
$dbpassword="XXXXXXXXXXXXXXXX";


$link = new PDO("mysql:host=$dbhost;dbname=$dbname"$dbusername$dbpassword);
$statement $link->prepare("INSERT INTO dbo.TB_User(StrUserID, password, sec_primary, sec_content)
    VALUES(:name, :pass, :sec_p, :sec_c)"
);
$statement->execute(array(
    
"name" => "testname",
    
"pass" => "e22a63fb76874c99488435f26b117e37",
    
"sec_p" =>  3,
    
"sec_c" =>  3
));

?>
I always get error code 500 and don't know what to do.. the SQL Port shall be open ( Proofed)..
Please Help
Quote:
$link = new PDO("mysql:host=$dbhost;dbname=$dbname", $dbusername, $dbpassword);
you will connect to mysql ??

im connecting is via mssql also sqlsrv
Quote:
$this->connect = new PDO("sqlsrv:Server=$host;Database=$dbs[WEB]",$user,$password);
also i never see that any create silkroad database for mysql

also change mysql:host to sqlsrv:host
NorseGodTyr is offline  
Old 06/28/2018, 22:12   #5
 
mindlessx's Avatar
 
elite*gold: 0
Join Date: Jun 2018
Posts: 20
Received Thanks: 0
Quote:
Originally Posted by mialuisa View Post
you will connect to mysql ??

im connecting is via mssql also sqlsrv

also i never see that any create silkroad database for mysql

also change mysql:host to sqlsrv:host

even when i pick the right format it cant connect..
Already tried many templates for Silkroad websites. I always get error 500

PHP Code:
<?php 

$cfg
['sql_host'] = "xxxxxxxxxxxxx,1443"
$cfg['sql_user'] = "sa"
$cfg['sql_pass'] = "xxxxxxxxxxxxx"
$cfg['sql_db'] = "SRO_VT_ACCOUNT"


$sqlLink mssql_connect($cfg[sql_host],$cfg[sql_user],$cfg[sql_pass]); 
    if(!
$sqlLink) die("MSSQL server is not accessable, why should we try to select database ?"); 
        else 
        { 
            
mssql_select_db($cfg[sql_db],$sqlLink); 
        } 
?>
mindlessx is offline  
Old 06/28/2018, 22:13   #6
 
B1Q's Avatar
 
elite*gold: 350
Join Date: Aug 2015
Posts: 2,008
Received Thanks: 1,193
don't use mssql it's been deprecated for the past 7 years
download wamp or some other webserver for development
install the sqlsrv extensions (download based on your php version 5.6+ advised)

pdo connection string
Code:
$sql = new PDO("sqlsrv:server=192.168.81.128,1433;database=SRO_VT_SHARD","sa","sqlpw");
B1Q is offline  
Thanks
1 User
Old 06/28/2018, 22:23   #7
 
mindlessx's Avatar
 
elite*gold: 0
Join Date: Jun 2018
Posts: 20
Received Thanks: 0
Quote:
Originally Posted by B1Q View Post
don't use mssql it's been deprecated for the past 7 years
Who the fuck cares? I started with sqlsrv, as you see. I't didn't worked. I read all treads within those who were 7 yeas old. Now im pretty sure, its not the way of connection, causing my troubles..

My first way of connection is 100% correct..

Quote:
Originally Posted by B1Q View Post
don't use mssql it's been deprecated for the past 7 years
download wamp or some other webserver for development
install the sqlsrv extensions (download based on your php version 5.6+ advised)

pdo connection string
Code:
$sql = new PDO("sqlsrv:server=192.168.81.128,1433;database=SRO_VT_SHARD","sa","sqlpw");
couldnt you just tell me, "you have to install sqlsrv extensions" A WEEK AGO?
mindlessx is offline  
Old 06/28/2018, 22:56   #8
 
NorseGodTyr's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 2,223
Received Thanks: 1,482
Quote:
Originally Posted by mindlessx View Post
Who the **** cares? I started with sqlsrv, as you see. I't didn't worked. I read all treads within those who were 7 yeas old. Now im pretty sure, its not the way of connection, causing my troubles..

My first way of connection is 100% correct..



couldnt you just tell me, "you have to install sqlsrv extensions" A WEEK AGO?
use zend is one of the best webserver install sqlsrv and setup your webpage
NorseGodTyr is offline  
Old 06/29/2018, 00:29   #9
 
B1Q's Avatar
 
elite*gold: 350
Join Date: Aug 2015
Posts: 2,008
Received Thanks: 1,193
Quote:
Originally Posted by mindlessx View Post
couldnt you just tell me, "you have to install sqlsrv extensions" A WEEK AGO?
i don't like posting dms on public forum but here it is

you never said you're having an error in your webpage
P.S. if you can't read an error message, i can't help you.
B1Q is offline  
Reply


Similar Threads Similar Threads
$2.80 Full-Access Premium Minecraft accounts [semi FULL ACCESS] and Full access
07/17/2017 - Minecraft Trading - 1 Replies
★★ Full-Access Premium Minecraft accounts ★★ To buy add me on skype: xXWaffleFaceXx Hey guys, I'm selling Semifull and Full-access Unmigrated Minecraft accounts. That means you can do the following things: ✔ Change Skin ✔ Change Username ✔ Change Password ✔ Change E-mail ✔ And much more! WITH THE ACCOUNTS I SELL YOU YOU CAN CHNAGE ANYTHING INCLUDING USERNAME AND EVEN EMAIL, its like normal mojang account
CentOS PHP 7 PDO MySQL Access denied
01/20/2016 - Unix/Linux - 11 Replies
Hello, I'm trying to using PHP 7 on my CentOS system. The Problem is that it's refusing my MySQL user thorugh PDO. I don't know why. I tried the same code on my local system, also running PHP 7, and it's working fine. Also I tried to connect through Navicat and it works too. And yes I installed php70w-mysql. atal error: Uncaught PDOException: SQLSTATE Access denied for user 'root'@'myCoolServer.epvp' (using password: YES) ... Does anyone have a solution for my problem? German:
Load Local Error(local/hong kong/local_game.txt) ?!
02/15/2010 - Metin2 Private Server - 5 Replies
Wenn ich mich mit China.Exe einlogg kommt diese Fehlermeldung.. mit normaler Deutscher aber nicht.. Wieso? wäre nett wenn mir jemand helfen könnte:rolleyes: Mfg: Saishi
Load Local Error(local/hong kong/local_game.txt) ?!
11/20/2009 - Metin2 Private Server - 23 Replies
Ich hab mir heute einen P-server gebaut, aber ich habe ein problem.Wenn ich versuche meinen P-server zu öffnen kommt die Feherlmeldung: Load Local Error(local/hong kong/local_game.txt). Weiß jemand wie man dieses Problem beheben kann ? Wäre echt nett wenn mir mal jemand dabei hilft !! :D



All times are GMT +1. The time now is 00:08.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.