#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    2
    Rep Power
    0

    Question Can PHP talk to MSSQL & MySQL both?


    We are currently on a large project in which we need to use a shopping cart that has been written in PHP and talks to MySql on Linux. This is fine, we have one and it works great, however we need to modify it to update an MSSQL 7 Database running on WINDOZE 2000 (I know WINDOZE bad!) however it is a fact of life that we have to live with because the existing application that we have to integrate with lives on WINDOZE 2000 and uses MS SQL 7 as its database. We have tried unsuccessfuly to use FreeTDS to talk to MS SQL followed the tutorial on installing it and after multiple tries (15 or more) finally came up with a combination that compiled successfuly. When trying to connect with mssql_connect () we get the message: call to undefined function mssql_connect (), also have tried to use sybase_connect () with the same basic result. Can anyone shed some light on this?
  2. #2
  3. No Profile Picture
    Not there when you need me
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Oct 2001
    Location
    Berlin, Germany
    Posts
    1,430
    Rep Power
    14
  4. #3
  5. No Profile Picture
    MCP
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    Canada
    Posts
    66
    Rep Power
    14
    And when in doubt about what PHP natively supports... Check out the functions listing in the manual!

    http://www.php.net/manual/

    - S A Curnew, MCP
  6. #4
  7. Wiking
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Sep 2000
    Location
    Sweden
    Posts
    3,608
    Rep Power
    27
    I take it as you're running PHP, MySQL and Apache on a Linux box, from where you wish to connect to a W2K box running MS SQL.
    Well, I've also done that. There's a tutorial over at PHPBuilder that worked for me, although I had to change one configure parameter when I recompiled PHP. --with-sybase-something, if I recall it correctly...
    Then just add your config stuff in the FreeTDS config file, and it is supposed to work...

    But the undefined function error you get is not fixed by changing the extension stuff in php.ini (if you're running *nix). The support for MSSQL has to be compiled into PHP, and it doesn't sound as if you've got that part working, and hence the error.
    Probably a dumb question, but I got to ask it: Have you recompiled PHP?
    If so, did you see the 'support for sybase... YES' line?

    And you're supposed to use the mssql_* functions in PHP for this...

    //NoXcuz
    UN*X is sexy!
    who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    2
    Rep Power
    0
    Yes, I have recompiled PHP but didn't sit and watch it so I didn't see (support for sybase....yes) I can only ***-u-me that it said that since I configured it to use sybase before compiling and it compiled clean reporting no errors. Also the functions listing in the PHP Manual says mssql support can only be used if PHP is running on a Windoze box and I really wish to use windows only where absolutely necessary (Windoze=BAD, and I don't wish to be forever tied to it. If I could talk the client into it I would move thier data to MySQL and not use Windoze at all.)
  10. #6
  11. Wiking
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Sep 2000
    Location
    Sweden
    Posts
    3,608
    Rep Power
    27
    Does this give you any help? php with sql server

    //NoXcuz
    UN*X is sexy!
    who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep

IMN logo majestic logo threadwatch logo seochat tools logo