| | |
Using PHP to connect to remote MSSQL database
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jul 2004
Posts: 494
Reputation:
Solved Threads: 21
Hello,
I installed PHP 5 on my Server 2003 machine with IIS and got that working properly. I want to connect to my school's MS-SQL student database, but PHP balks when it hits "mssql_connect" (or whatever the statement is). How can I set this up so I can actually connect to the database?
Apparently I need a file that's included with SQL Server (which I don't have) in order to get PHP to do this. Is there a way to get this file (nwtdb--something) so I can connect the database?
The whole motivation with this is being able to write and test the PHP code for the database without having to find times one of the labs on campus is open... they won't give users FTP access so you can't upload your files and test them from the web interface on their machine.
I installed PHP 5 on my Server 2003 machine with IIS and got that working properly. I want to connect to my school's MS-SQL student database, but PHP balks when it hits "mssql_connect" (or whatever the statement is). How can I set this up so I can actually connect to the database?
Apparently I need a file that's included with SQL Server (which I don't have) in order to get PHP to do this. Is there a way to get this file (nwtdb--something) so I can connect the database?
The whole motivation with this is being able to write and test the PHP code for the database without having to find times one of the labs on campus is open... they won't give users FTP access so you can't upload your files and test them from the web interface on their machine.
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
•
•
Join Date: Jan 2005
Posts: 18
Reputation:
Solved Threads: 2
Hi
You first need the information that your school has given you to access the database...
This will include...
Database User Name
Database Password
Database Server Name
Database Server Port (#) it is listening on
Database Name you have permission to access
Database tables you have permissions to access
One you have this then you can connect using the following PHP functions
demo
You first need the information that your school has given you to access the database...
This will include...
Database User Name
Database Password
Database Server Name
Database Server Port (#) it is listening on
Database Name you have permission to access
Database tables you have permissions to access
One you have this then you can connect using the following PHP functions
PHP Syntax (Toggle Plain Text)
// connect $cs = mssql_connect ( 'server_name:port', 'username', 'password' ) or die ( 'Can not connect to server' ); // select mssql_select_db ( '[database_name]', $cs ) or die ( 'Can not select database' ); //query $sql = "SELECT * FROM [TABLENAME]"; $r = mssql_query ( $sql, $cs ) or die ( 'Query Error' ); // loop the result while ( $row = mssql_fetch_array ( $r ) ) { /* do stuff */ }
demo
•
•
Join Date: Jun 2006
Posts: 4
Reputation:
Solved Threads: 1
hello to all
i want connect to mssql insist of mysql ,i want design a web site with [php nuke],as default this CMS work with mysql,and how i can change setting that php read table of (sql server) insist of mysql.???
plz explain with details[i am in low level]
i am wait for your responses.
i hope that put this question in suitable place.
thanks
i want connect to mssql insist of mysql ,i want design a web site with [php nuke],as default this CMS work with mysql,and how i can change setting that php read table of (sql server) insist of mysql.???
plz explain with details[i am in low level]
i am wait for your responses.
i hope that put this question in suitable place.
thanks
•
•
Join Date: Jun 2006
Posts: 10
Reputation:
Solved Threads: 1
hey wht u r using to connect with mysql
i also use php in window with IIS server and using mysql but i connect it very easy.
mysql_connect("host_name","user","password")
simple hai agar koi problem ho thn mail me -----manish812@gmail.com
i also use php in window with IIS server and using mysql but i connect it very easy.
mysql_connect("host_name","user","password")
simple hai agar koi problem ho thn mail me -----manish812@gmail.com
•
•
Join Date: Jun 2006
Posts: 4
Reputation:
Solved Threads: 1
hello
thanks alot of your attention.
yes,i know that mysql is better ,but my boss wants change (mysql db) to (sql server db) for (nuke[that is a CMS]).
you know that (nuke)works as default with (mysql).and i want change [connections] is special files .but i donot know where are they????and how??
do you work with nuke????and do you can help me??
i am very confused.
thanks of you .
i am wait for your response.
[plz wirte to me only to english]
with best regards.
good bye
thanks alot of your attention.
yes,i know that mysql is better ,but my boss wants change (mysql db) to (sql server db) for (nuke[that is a CMS]).
you know that (nuke)works as default with (mysql).and i want change [connections] is special files .but i donot know where are they????and how??
do you work with nuke????and do you can help me??
i am very confused.
thanks of you .
i am wait for your response.
[plz wirte to me only to english]
with best regards.
good bye
![]() |
Other Threads in the PHP Forum
- Previous Thread: Php Spacing
- Next Thread: PHP Joomla
| Thread Tools | Search this Thread |
apache api array auto beginner binary broken cache cakephp checkbox class cms code codingproblem cron curl customizableitems database date display dynamic echo email error errorlog file files filter folder form format forms forum function functions gc_maxlifetime global google headmethod href htaccess html image include insert ip javascript joomla limit link login mail malfunctioning memmory memory menu method mlm multiple mysql nodes oop parameter parsing paypal pdf php phpmysql popup query radio random recursion recursiveloop remote script search select server sessions snippet source space sql static survey syntax system table trouble tutorial up-to-date update upload url validator variable video web youtube





