I know it sucks helping out a newbie but if anyone has the patience please help. I started off with php and mysql to learn online db. I'm trying to create a intranet with a knowledge base. So I'll be using SQL 7 and php. The commands for mysql were faily easy
Thats how I started off with, but in sql 7 its just totally foreign for me..
How do I connect to the SQL Db? is the same way? Because I dont remeber ever having to use a username or password since i used local system info. Anyone willing to help me get started? Thats ALL i need.. just a little boost so that i can start learning.. cuz right now i dont know what the hell im doing... i used tutorials to query and all but not to get this thing on the web.. thanks..
Fatal error: Call to undefined function: mssql_connect() in c:\program files\apache group\apache\htdocs\sqltest.php on line 10
Line 1 <html>
Line 2 <head></head>
Line 4 <?php
Line 5 $hostname = "localhost";
Line 6 $username = "sa";
Line 7 $password = "";
Line 8 $dbName = "test";
Line 10 MSSQL_CONNECT($hostname,$username,$password) or DIE("DATABASE FAILED
mssql_select_db($dbName) or DIE("Table unavailable");
Why would I get such an error? I took out $password and still got the same problem, Is it an auth. problem?
You need to download the MS SQL server libraries for PHP (dll files). If you check out the page I sent and search for 'dll' it should show you where to download and how to install. By default, PHP only comes with MySQL support and you need to install separate DLL packages for different databases you want to connect to (Sybase, Oracle, MS SQL, etc.).
" The MSSQL extension is available on Win32 systems only. You can use the Sybase extension to connect to MSSQL databases from other platforms.
These functions allow you to access MS SQL Server database. The extension requires the MS SQL Client Tools to be installed on the system where PHP is installed. The Client Tools can be installed from the MS SQL Server CD or by copying ntwdblib.dll from \winnt\system32 on the server to \winnt\system32 on the PHP box. Copying ntwdblib.dll will only provide access. Configuration of the client will require installation of all the tools.
The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini. "
They actually had their own little posting forum there and I read all of them, but it doesnt work. Infact they mention about getting a php_mssql70.dll from the zip archive at php.net but its not in there. Also after typing dll in a search I only get the above info in a link but does not inform me where to get it. I tried just using the mssql.dll people say it doesnt work, and so far I believe them because I havent been able to get it to work.0
I remember a couple years ago when I was using PHP3 and MS SQL 7 that I could never get the MS SQL DLLs working (they always crashed IIS). What I had to end up using was ODBC. It worked fine for our purposes and I suspect it will be OK for you as well. Remember that ODBC isn't the fastest thing in the world but it will (should ) work fine. P.S. the functions are just like MS SQL, just 'odbc_connect' and such. Remember to look at php.net/odbc for help.