• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

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
 
Newbie Spellweaver
Joined
Oct 4, 2004
Messages
24
Reaction score
0
yerror says that MSSQL server is not correctly set in settings file. just rechek
 
Newbie Spellweaver
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