Jump to content

Recommended Posts

Hi,

 

Can please someone help me . . .

 

I have been using the old version of PHP & MYSQL using Windows XP in my deskstop with out problem even at the start of installation.

 

I just bought a new laptop it comes with Windows Vista on it. I have downloaded the latest version of Apache (2.0.61 win 32), PHP (5.2.5) and Mysql (5.0.45) my problem is whenever is tried to connect to my database it does not work and worst of all does not give me any hint at all whats the problem to fix it

 

here's my code

 

<?php

echo 'a';

mysql_connect("localhost", "rootadd", "reane") or die(mysql_error());

echo "Connected to MySQL<br />";

mysql_select_db("test") or die(mysql_error());

echo "Connected to Database";

?>

 

 

Output is just a.

 

even if I modify the user and password to be different its the same output. I remember in my desktop at least it will tell me that the user does not exist or the password is wrong . . .

 

Is this just a configuration issue ? if yes, can you please let me know which one to adjust . . .

 

Is there other way to check if MYSQL is working properly ?

 

Any solution or test that I can do to show the errors ?

 

Thanks you very much . . .

 

Ron

 

Link to comment
https://forums.phpfreaks.com/topic/82916-solved-php-mysql-using-windows-vista/
Share on other sites

Thanks for reply . . .

 

PHP_PhREEEk,

I did try it same error, it seems its terminated when it hits the mysql_connect, by right it should display mysql_Error.

 

crashmaster,

I wait first if others have the same problem else need to reinstall all over again . . .

 

 

Any more idea ?

 

Interesting that echo "Connected to MySQL isn't printing, so that means that the script is dealt a fatality at the connect request... yet no error... hmm...

 

Shall we try:

 

<?php
echo 'a';
if ( !mysql_connect("localhost", "rootadd", "reane") ) {
    echo 'Could not connect to MySQL! Error: ' . mysql_error();
} else {
    echo "Connected to MySQL!";
}
mysql_select_db("test") or die(mysql_error());
echo "Connected to Database";
?>

 

Post back output...

 

PhREEEk

Make sure you have configured PHP to use the mysql extension, by default PHP5 does not come with mysql builtin (like PHP4 did). Also you'll need to enable the display_errors directive within the php.ini in order for PHP to return any errors during runtime, by default this setting is disabled but PHP will log errors via Apaches error log.

 

To see if the mysql extension has been enabled you can run the following simple script:

<?php phpinfo(); ?>

That will produce a page full of PHPs current configuration/environment. Scroll down and see if you can find a MySQL heading. If you can't find a MySQL heading then the mysql extension is not enabled and thus your code just outputs "a". Please read this FAQ for doing so.

I think I did, here is my phpinfo look like,

 

extension_dir c:\Server\Apache Group\Apache2\ext c:\Server\Apache Group\Apache2\ext

 

Sorry, I pointed it to Apache instead of PHP, let me change it first and let you know the output . . .

 

 

What did you do with the file called libmysql.dll? the mysql extension relys on this library if PHP cannot find this file then the mysql extension wont load properly. By default libmysql.dll is located in your PHP installation folder.

 

I'd advise you on adding your PHP folder to PATH environment variable.

I did change it already but not so sure what to do libmysql.dll

 

copied from MySQL folder and moved it to PHP folder but the notes says

 

'so make sure you have copied a file called libmysql.dll to the windows folder too'

 

which windows folder ?

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.