mssql_query returns "Query failed"
Can't seem to find any solution to this, no matter how hard I google. I have a deadline tomorrow and need this to be resolved asap, hope that someone here can give me a hint :)
Basically I'm connecting to a MSSQL-server from PHP. Like so:
$db_server = 'servername';
$db_user = 'user';
$db_pwd = 'pwd';
$db_db = 'dbname';
$link = mssql_connect($db_server, $db_user, $db_pwd);
if (!$link || !mssql_select_db($db_db, $link)) {
die('Something went wrong while connecting to MSSQL');
}
After that I try to run this code:
mssql_query("CREATE TABLE #开发者_开发知识库#TempUserTable (UserID VARCHAR(30))", $link);
And then I get this error:
Warning: mssql_query() [function.mssql-query]: Query failed in /var/www/test.php on line 4
And yes, I've fixed the serverstuff in freetds.conf and it should be able to create a temporary table. It worked before and it's working from Eclipse / SQLExplorer.
I'm getting frustrated!
Thanks in advance! :)
精彩评论