Jump to content

question about using sql server with php


sudhakararaog

Recommended Posts

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

 

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.