Jump to content

Trying to connect to MySQL


SamDOD

Recommended Posts

I downloaded a PHP/Ajax chat room script. It works great when i run it localhost and use PHP 5. I need to run it on a server now that is running PHP 4. I believe it has to do with this one line. But i could be wrong.

 

Line 26:

mysql_connect($a_base['dbhost'], $a_base['dbuser'], $a_base['dbpass']);

 

Everything sets up correctly in the install, in that it creates its tables in the Database i create. so it does connect to that database as one point. i get one error and it wont go any further.

 

PHP Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\wchat\functionz\columns.php on line 26

 

Can anyone help?

 

  Thank you very much

Link to comment
Share on other sites

If that is true, then how does it create the tables in the database when i run the installer. not to mention it says "localhost" when i am using an ip address to link to the database?

 

I read about editing the php.ini file to allow the extension php_mysql.dll but i am running this on a vortech hosting server and am not sure how to accomplish this.

 

Any suggestions?

 

 

Thank you for all your help.

Link to comment
Share on other sites

My guess would be that the configuration file that the script stores the information you entered (database server ip address...) was either not successfully saved or the code contains a logic error and it does not use the correct setting later.

 

Check if there is a configuration file that the script creates and check what is stored in it.

 

My guess is a logic error either caused the configuration file to be written with "localhost" instead of the ip address or $a_base['dbhost'] got overwritten by a logic error in the code. You would need to post code or a link to the script's download site so that someone could examine what it is doing.

Link to comment
Share on other sites

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.