Menu

Can I use mysql_connect() from Dev-PHP IDE ?

B. K.
2006-11-06
2012-12-07
  • B. K.

    B. K. - 2006-11-06

    Hi all,
           I am new to MySQL, although reasonably conversant with PHP. I have always used the internal preview of the Dev-PHP IDE (version 2.0.12) to do the development. Now that I am starting to learn MySQL, I tried to do just a mysql_connect() from within a php script. When I use internal preview, I get the following error message.

    Connecting to MySQL @ localhost
    PHP Fatal error: Call to undefined function mysql_connect() in C:\.....\test.php on line 10

    When I do phpinfo(), I don't see anything about mysql, but I see some reference to SQLite.

    Am I supposed to do something additional to be able to connect to mysql from
    the IDE ? Or is mysql not usable at all through Dev-PHP ?

    Thanks for your help in advance.

    B.K.

     
    • keenblade

      keenblade - 2006-11-06

      Hi, your problem is not with Dev-php. All you have to do is configure your web server, php and mysql to work together. I assume you installed mysql, too. It seems you have not configured your php.ini file to use mysql. Find php.ini and delete the comments string ";" from the following lines
      extension=php_mysql.dll
      extension=php_mysqli.dll
      if they are not exist add them to the similar lines (under "Windows Extensions" section ). The php.ini file is under your php installation folder. If the file is not there, rename php.ini-recommended to php.ini and edit the mentioned lines.
      Then check phpinfo()again, if you see mysql section. Don' forget to restart your server after changes.

       
      • B. K.

        B. K. - 2006-11-06

        Thanks keenblade, I had to just uncomment the mysql.dll line under Winodows extensions. Now I can connect to mysql. I am planning to only develop/debug
        here (for learning sake) and deploy on a webserver somewhere else. Are there
        any important issues I should know about (such as a discrepancy of behavior
        the code in preview vs. the behavior on a real webserver) ? Is there a place
        for this kind of documentation ?

        Thank you again.

        b.k.

                          

         
        • Pierre Fauconnier

          Hi,

          > Is there a place for this kind of documentation ?

          May I suggest that this forum seems an excellent place ?

          Regards,
          Pierre.

           
      • Pierre Fauconnier

        Excellent support. Thanks again, Keenblade !

        Best regards,
        Pierre.

         

Log in to post a comment.

MongoDB Logo MongoDB