[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 794
  • Last Modified:

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\php-eg\dbEg.php


Hi All,
             We have installed PHP 5.0.5 (using the pack “php-5.0.5-installer.exe”) and MySQL 5.0.16 (using the pack “Setup.exe” from “mysql-5.0.16-win32.zip”) on Windows XP.  We tried executing a simple program like the below using IIS 5.0 web server. It worked well.

<HTML>
<HEAD>
 <TITLE>Test program</TITLE>
</HEAD>

<BODY>
 <H2> Test program </H2>
 <BR>
 <?
      echo "Hello World";
      
 ?>
</BODY>
</HTML>


But we are getting the following error when we tried to execute the following script i.e. when we PHP program tried to connect to MySQL database which has been installed locally.  It seems some configuration settings or dlls problem. So would any one please suggest how we can over come this error?

Error:
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\php-eg\dbEg.php on line 11

Code:
<HTML>
<HEAD>
 <TITLE>Vinyl Dealers: Search Results</TITLE>
</HEAD>

<BODY>
 <H2>Search Results</H2>
 <BR>
 <?
      // Connect to database and select database 'vinyldealers'
      $db = mysql_connect("localhost");
      mysql_select_db("vinyldealers", $db);

      // Find all record shops that stock the genre of music specified by the user
      $query = "SELECT shops.name, shops.phone, shops.email, shops.website
            FROM shops INNER JOIN shopgenres ON shops.shopID = shopgenres.shopID
            WHERE shopgenres.genreID = ".$genre;
      $result = mysql_query($query);

      // Return the data and display it
      while ($record = mysql_fetch_assoc($result)) {
            while (list($fieldname, $fieldvalue) = each ($record)) {
                  echo $fieldname.": <B>".$fieldvalue."</B><BR>";
            }
            echo "<BR>";
      }
 ?>
</BODY>
</HTML>

0
Anupama_2005
Asked:
Anupama_2005
  • 3
  • 2
  • 2
  • +2
1 Solution
 
RoonaanCommented:
make sure that in your php.ini there is no semicolon from the mysql dll.

-r-
0
 
Anupama_2005Author Commented:
Hi Roonaan,
                    I have done that. Still not working. Now I am getting the following error.

PHP Warning: PHP Startup: Unable to load dynamic library './php_mysql.dll' - The specified module could not be found. in Unknown on line 0

Would you please help?

Thanks.
0
 
RoonaanCommented:
Have you checked the existence of your dll then?

-r-
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Georgiana GligorCommented:
Maybe your extension_dir is not pointing to the right location, or that your dll is not in that directory.

Cheers,
  GB
0
 
dr_dedoCommented:
please take a look at this post
http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_21790679.html

hope it helps

0
 
Anupama_2005Author Commented:

Hi All,
         The problem is due to wrong dll.  I tried using the dlls from php-5.0.5-Win32.zip file which solved my problem. Acutally I got this soution from some other web site while quering google. Now I am deleting this question.

Thanks all for your time and help.
0
 
dr_dedoCommented:
congratulations on solving ur problem, but it is unfair to delete the question after a user has submitted an acceptable solution to solve your problem!! u can delete your question if u managed to solve it on your own while none else menaged to solve it for you, here, it is not the case, the link i post you, got the versy same answer you asked for.... it is unfair to delete a question with a good answer in it even if u found the answer on another website...
0
 
dr_dedoCommented:
i've post a comment with a very same question that i answered before, with the very same answer Anupama was searching for
0
 
CetusMODCommented:
PAQed with points refunded (500)

CetusMOD
Community Support Moderator
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now