Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2002
    Posts
    7

    Post Unanswered: [Newbie] SQL 7 + Php

    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

    $db = mysql_connect("localhost", "root");
    mysql_select_db("mydb",$db);
    $result = mysql_query("SELECT * FROM employees",$db);

    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..

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    I am not sure if NT authentication is availible on PHP.

    http://www.php.net/manual/en/function.mssql-connect.php
    Thanks,

    Matt

  3. #3
    Join Date
    Jan 2002
    Posts
    7

    thank you so much

    THANK YOU SOOO MUCH, ive been looking around for days on yahoo.com typin in searches like sql and php or sql + php , sql and php intergration etc...

  4. #4
    Join Date
    Jan 2002
    Posts
    7

    another newbie question

    Just help me get started.. anyone? 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 3<body>
    Line 4 <?php
    Line 5 $hostname = "localhost";
    Line 6 $username = "sa";
    Line 7 $password = "";
    Line 8 $dbName = "test";
    Line 9
    Line 10 MSSQL_CONNECT($hostname,$username,$password) or DIE("DATABASE FAILED
    TO RESPOND.");
    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?

  5. #5
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    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.).
    Thanks,

    Matt

  6. #6
    Join Date
    Jan 2002
    Posts
    7

    thanks again but

    I did go there and i get

    " 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

  7. #7
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    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.
    Thanks,

    Matt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •