I got a problem about using PHP+MSSQL
when I want to open a database which is created by me
It can't run....
If I open a default database (ex:master),it's ok..
but I can't select the datasheet which is created by me...
mssql_connect('locahost','','');
mssql_select_db('God'); //ERROR
mssql_connect('localhost','','');
mssql_select_db('master');
$qstring="select * from user";
mssql_query($qstring); //ERROR
what should I do???
Thanks a lot!!!!!!!
PHP+MSSQL?????????????
Moderator: General Moderators
Try using
And give us the error that you receive.
Code: Select all
<?php
mssql_connect('locahost','','');
mssql_select_db('God') or die(mssql_error() . " (LINE 2)");
mssql_connect('localhost','','');
mssql_select_db('master');
$qstring="select * from user";
mssql_query($qstring) or die(mssql_error() . " (LINE 2)");
?>because I use Traditional Chinese version...
the error messages are Chinese....
follow is the error messages:
Warning: MS SQL message: 無法判斷資料庫 'God' 在 sysdatabases 上的列位置。找不到該名稱的項目。請確定名稱輸入正確。 (severity 16) in d:\appserv\www\testdb.php on line 10
Warning: MS SQL: Unable to select database: God in d:\appserv\www\testdb.php on line 10
Fatal error: Call to undefined function: mssql_error() in d:\appserv\www\testdb.php on line 10
Thanks a lot
the error messages are Chinese....
follow is the error messages:
Warning: MS SQL message: 無法判斷資料庫 'God' 在 sysdatabases 上的列位置。找不到該名稱的項目。請確定名稱輸入正確。 (severity 16) in d:\appserv\www\testdb.php on line 10
Warning: MS SQL: Unable to select database: God in d:\appserv\www\testdb.php on line 10
Fatal error: Call to undefined function: mssql_error() in d:\appserv\www\testdb.php on line 10
Thanks a lot
