sudhakararaog Posted October 27, 2008 Share Posted October 27, 2008 i have a question about how to use sql database with php instead of using my sql database when i use my sql database the php code to connect to the my sql database is = $conn = mysql_connect($hostname, $user, $password); if(!$conn) { echo "Unable to connect to Database"; } else { mysql_select_db($database, $conn); $query = mysql_query($selectquery); mysql_close($conn); } if i have to connect to a sql databse instead of my sql database as some companies use sql database, how can i change the php code to connect, run a query and close connection to the sql database. apart from changing the code to connect to sql database is there something else i need to do. php my admin is used to access the tables in mysql database, which tool should be used to access data in the tables for sql database. please advice. thanks Link to comment https://forums.phpfreaks.com/topic/130223-question-about-using-sql-server-with-php/ Share on other sites More sharing options...
ratcateme Posted October 27, 2008 Share Posted October 27, 2008 i am not sure what you are saying but are you trying to connect to a database on a server that is not MySQL? what kind of server are you trying to connect to? Scott. Link to comment https://forums.phpfreaks.com/topic/130223-question-about-using-sql-server-with-php/#findComment-675373 Share on other sites More sharing options...
Alt_F4 Posted October 27, 2008 Share Posted October 27, 2008 AFAIK its pretty much the same: $conn = mssql_connect($hostname, $user, $password); if(!$conn) { echo "Unable to connect to Database"; } else { mssql_select_db($database, $conn); $query = mssql_query($selectquery); mssql_close($conn); } in regards to the tool used to access the data in the tables - you should have something like 'Enterprise Manager' installed - Have a look in start menu (if using windows) under All Programs -> Microsoft Sql Server Link to comment https://forums.phpfreaks.com/topic/130223-question-about-using-sql-server-with-php/#findComment-675374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.