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>

Anupama_2005Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Georgiana GligorCTO / OwnerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.