i'm writing the following code to connect to SQL Server
<?php
$username="username";
$password="password";
$ser='server';
$db_name='db_name';
$dsn="DRIVER={SQL SERVER};" .
"Server=$ser;".
"CommLinks=tcpip(Host=$ser);" .
"DatabaseName=$db_name;" .
"uid=".$username."; pwd=".$password."";
$sqlconnect=odbc_connect($dsn,$username,$password);
$sqlquery="select count(*) from table_name where condition;";
$process=odbc_exec($sqlconnect, $sqlquery);
$count=odbc_num_rows($process);
echo "$count";
odbc_close($sqlconnect);
?>
and i run this piece of code using appache server and i get the following error page, can anyone tell me what to do...????????????????
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'dbo.Characters'., SQL state S0002 in SQLExecDirect in C:\AppServ\www\rappelz\code.php on line 17
Warning: odbc_num_rows(): supplied argument is not a valid ODBC result resource in C:\AppServ\www\rappelz\code.php on line 20