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

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Genux
Forum Newbie
Posts: 4
Joined: Thu Dec 26, 2002 9:03 pm
Location: Changhua,Taiwan,ROC
Contact:

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

Post 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!!!!!!!
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post 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.
Image Image
Genux
Forum Newbie
Posts: 4
Joined: Thu Dec 26, 2002 9:03 pm
Location: Changhua,Taiwan,ROC
Contact:

Post 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
Post Reply