Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Help me. Register to MSSQL can't connect

Initiate Mage
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
 
Initiate Mage
Joined
Oct 4, 2004
Messages
24
Reaction score
0
yerror says that MSSQL server is not correctly set in settings file. just rechek
 
Initiate Mage
Joined
Apr 24, 2012
Messages
23
Reaction score
3
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
Top