Page 1 of 1

PHP+MSSQL?????????????

Posted: Sun Dec 29, 2002 8:18 am
by Genux
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!!!!!!!

Posted: Sun Dec 29, 2002 11:49 pm
by phice
Try using

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)"); 
?>
And give us the error that you receive.

Posted: Mon Dec 30, 2002 1:36 am
by Genux
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