hi all,
i have a problem, i have successfully connected my PHP code to SQL Server but when i try to connect to database which is my own database then i get this error
my code isCode:Warning: mssql_select_db() [function.mssql-select-db]: message: Could not locate entry in sysdatabases for database 'mynewdb'. No entry found with that name. Make sure that the name is entered correctly. (severity 16) in C:\Program Files\EasyPHP 2.0b1\www\MSSQL\ms.php on line 10
but when i use any system database which is installed with SQL Server then it gets connect succssfully and works fineCode:<?php $SQL = "SELECT * FROM Table1"; $h = mssql_connect("USER\SQLEXPRESS","",""); $db = mssqL_select_db("mynewdb"); echo $db; $Res = mssql_query($SQL); echo mssql_rows_affected($h)."<br>"; while($Row = mssql_fetch_array($Res)) { echo $Row[0]."\t".$Row[2]."<br>"; } ?>
code below works fine
why im not able to work with my own Database. how this problem can be resolved please helpCode:<?php $SQL = "SELECT * FROM sysconfigures"; $h = mssql_connect("USER\SQLEXPRESS","",""); echo $h; $db = mssqL_select_db("master"); echo $db; $Res = mssql_query($SQL); echo mssql_rows_affected($h)."<br>"; while($Row = mssql_fetch_array($Res)) { echo $Row[0]."\t".$Row[2]."<br>"; } ?>





Reply With Quote