Results 1 to 13 of 13

Thread: [solved] php to ms sql

  1. #1

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552

    [solved] php to ms sql

    i found some function ober mentioned about mssql_connect() and the like. i don't see it in my php manual. do i have to get this from somewhere? am i missing something? maybe i'm dumb but i need help. hehe. thanks.
    Last edited by brown monkey; Jul 22nd, 2004 at 02:37 AM.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    I found it in the php manual:

    http://www.php.net/mssql_connect

    Here's the page of al the MS SQL functions:

    http://uk2.php.net/manual/en/ref.mssql.php

    Edit:

    A little trick. If you want to go to the documentation for any PHP function just go to:

    http://www.php.net/function_name

    I.e: for foreach:

    http://www.php.net/foreach
    Last edited by visualAd; Jul 20th, 2004 at 04:03 AM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    thanks for the reply visualAd. i found it in the link you gave. i try this
    PHP Code:
    <?php
       mssql_connect
    ("localhost","sa","password");
    ?>
    i'm totally new to this thing but i want to learn. it has an error and says
    Code:
    Fatal error: Call to undefined function: mssql_connect() in D:\Program Files\Apache Group\Apache2\htdocs\examples\example.php on line 2
    i've got php version 4.3.5 and i found in the linke that you gave that the function mssql_connect() is featured in 3,4,5. am i missing something? thanks.
    Last edited by brown monkey; Jul 20th, 2004 at 04:12 AM.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    From the PHP manual:
    Requirements

    Requirements for Win32 platforms.

    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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Let me know if that doesn't work for you. I've been through the PHP/MSSQL installation a few times.

    edit: Don't forget to uncomment the extension in php.ini!!!
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  6. #6

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    hello mates. i know you guys are the best ones here. cheers and thanks for the reply. and oh, sorry for the late reply. still undefined. here's the thing i did

    1. look for ntwdblib.dll in c:\windows\system32. it's there.
    2. remove the ; in ;extension=php_mssql.dll

    i doubt i did the right one. hehe. help mates, please. hehe. the manual says something about compiling with the switch --with-mssql[=DIR] where DIR is the FreeTDS install prefix. what is this FreeTDS? thanks in advance.

  7. #7
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    You only need to worry about FreeTDS and --with-mssql if you are compiling PHP from source on a UNIX machine.

    As you are using Windows this is not an issue and just the modification to the PHP.ini should be necessary and copying the required dll.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  8. #8

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    thanks. yes i'm in winxp. hehe. please don't ask. hehe. still undefined function: mssql_connect(). every start of my pc, it says something about Unknown(): Unable to load dynamic library './php_mssql.dll' - The specified module could not be found. am i missing something like setting where to put exactly the dll??? and oh. sorry for bothers and thanks.

  9. #9

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    hoping for ober0330 to drop by.

  10. #10
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Have you checked that you've got the php_mssql.dll in your extensions directory??
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  11. #11

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    hello mate [visualAd]. yep. how come i can't connect??? thank you sooo much for being patient mate. thanks.

  12. #12
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Its saying that it cannot find the extension file. You'll need to edit the follwoing directive in the php.ini to include the directory your extension lphp_mssql.dll lives or copy it to the same directory as your PHP binary.

    Code:
    ; Directory in which the loadable extensions (modules) reside.
    extension_dir = ".\" <-- change this to the directory path of extensions
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  13. #13

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    that's it. i'm dumb. hahaha. it's ok now mate. thank you sooooooooo much. good day mate. again, thank you thank you thank you.

    thanks times ten to the power of forever.

Posting Permissions

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



Click Here to Expand Forum to Full Width