Welcome!

Join our community of MMORPG enthusiasts and private server developers! By registering, you'll gain access to in-depth discussions on source codes, binaries, and the latest developments in MMORPG server files. Collaborate with like-minded individuals, explore tutorials, and share insights on building and optimizing private servers. Join us today and unlock the full potential of MMORPG server development!

Join Today!

Help me. Register to MSSQL can't connect

Newbie Spellweaver
Joined
Apr 24, 2012
Messages
23
Reaction score
3
Hi guys..

Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied., SQL state 08001 in SQLConnect in C:\AppServ\www\register.php on line 7
Can't connect the MSSQL server.

What i do?

I'm sorry
i'm brazilian
 
yerror says that MSSQL server is not correctly set in settings file. just rechek

<?php
$host = "mmo\sqlexpress/127.0.0.1";
$user = "sa";
$pass = "137946";
$dbname = "RZ_ACCOUNTDB";

$connect = odbc_connect("Driver={SQL Server};Server={$host}; Database={$dbname}", $user, $pass) or die("Can't connect the MSSQL server.");

$userid = $_Post['username'];
$pass = $_Post['password'];
$login = md5($userid . ' ' . $pass);

$result = odbc_exec($connect, "SELECT USER_ID FROM RZ_ACCOUNTDB WHERE USER_ID = '$userid'");
$existing_users = num_rows($result);
if($existing_users >= 1) {
echo "Username in use.";
}

if (!$_POST['username'] )
{
die('You left User ID field blank');
}

if (!$_POST['password'] )
{
die('You left Password field blank');
}

odbc_exec($connect, "INSERT INTO RZ_ACCOUNT (USER_ID, SITE_CODE, SITE_USER_ID, PWD, ACC_PTM) VALUES ('$login', '$userid', '$login', '$pass', '0')");

?>
 
Back