Please Help

Discussion in 'PHP' started by atprashant, Feb 22, 2007.

  1. #1
    i am using PHP,Mysql and IIS server.
    my problem is that when i am using a mysql_connect() function in my program for connecting database then browser display an error message-
    Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\mysqldemo.php on line 2.
    i am not understanding how this problem i solve.

    please help
     
    atprashant, Feb 22, 2007 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Whats on line 2?
     
    mad4, Feb 22, 2007 IP
  3. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Probably your PHP hasn't been compiled with the mysql extension - what do you get if you do a
    phpinfo(INFO_GENERAL);
    PHP:
    ?
     
    picouli, Feb 22, 2007 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    You are using php 5.

    Enable mysql dll in php.ini.

    Peace,
     
    Barti1987, Feb 22, 2007 IP
  5. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    and remember to restart IIS after which so that the PHP.ini is load back into the memory again :)
     
    tanfwc, Feb 22, 2007 IP
  6. Dominicc2003

    Dominicc2003 Peon

    Messages:
    853
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I don't know how to solve your problem but... I would advise using a more descriptive thread name next time... Then you'll receive more "targetted" views.
     
    Dominicc2003, Feb 22, 2007 IP
  7. coolguy123

    coolguy123 Guest

    Messages:
    59
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    in your php.ini,
    Add the following line to the end
    Also, make sure MYSQL is linked in PHP by checking
     
    coolguy123, Feb 22, 2007 IP
  8. atprashant

    atprashant Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Sir I have get Followinf Output,so what i have to do?

    System Windows NT KUMAR-SCS 5.1 build 2600

    Build Date Feb 7 2007 23:10:31

    Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"

    Server API ISAPI

    Virtual Directory Support enabled

    Configuration File (php.ini) Path C:\WINDOWS

    PHP API 20041225

    PHP Extension 20060613

    Zend Extension 220060519

    Debug Build no

    Thread Safety enabled

    Zend Memory Manager enabled

    IPv6 Support enabled

    Registered PHP Streams php, file, data, http, ftp, compress.zlib

    Registered Stream Socket Transports tcp, udp

    Registered Stream Filters convert.iconv.*, string.rot13, string.toupper,

    string.tolower, string.strip_tags, convert.*, consumed, zlib.*
     
    atprashant, Feb 23, 2007 IP
  9. atprashant

    atprashant Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    i write this at line 2.please help me
    $con=mysql_connect('localhost','root','root');
     
    atprashant, Feb 23, 2007 IP
  10. krishna77

    krishna77 Peon

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    your password is
    if root then it's ok. if you not set root password then you have to write like that
    $con=mysql_connect('localhost','root','');or
    $con=mysql_connect('localhost','root');

    default password is '';
     
    krishna77, Feb 23, 2007 IP
  11. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
    Code (markup):
    MySQL wasn't configured at compile time - you need to ask your ISP (or whoever) to re-compile PHP with MySQL support
     
    picouli, Feb 23, 2007 IP
  12. coolguy123

    coolguy123 Guest

    Messages:
    59
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #12
    this is not the case guys, he is using IIS server and he just hasn't enabled the mysql library in the php.ini
     
    coolguy123, Feb 23, 2007 IP
  13. DeViAnThans3

    DeViAnThans3 Peon

    Messages:
    785
    Likes Received:
    83
    Best Answers:
    0
    Trophy Points:
    0
    #13
    If he can do so, your problem will be solved; as this is the typical error for MySQL lib not being used in php.ini :)
    Your IIS server needs to be restarted after modification had been completed. Note that MySQL of course also needs to be installed on the server ;)
     
    DeViAnThans3, Feb 23, 2007 IP
  14. atprashant

    atprashant Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    sir i put the php.ini file in window folder and made following changes-

    extension_dir="c:\php\ext"

    uncomment the file--------- extension=php_mysql.dll\

    i have configure the IIS with php with php5isapi.dll file.

    after this setting i am getting error.
    phpinfo(); is properly working.
     
    atprashant, Feb 23, 2007 IP
  15. DeViAnThans3

    DeViAnThans3 Peon

    Messages:
    785
    Likes Received:
    83
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Did you already restarted IIS?
    And which error are you getting? :)
     
    DeViAnThans3, Feb 23, 2007 IP