Skip to main content
Known Participant
June 10, 2010
Question

PHP MySql connection to GoDaddy

  • June 10, 2010
  • 1 reply
  • 2196 views

I use DWCS4, PHP, MySQL. I have created a MySql database on my GoDaddy-hosted account and can FTP to it and have transferred tables and data to it. However, when I try to create a database connection in DW, I get the following error message; "Your PHP server does not have the MySQL module loaded or you can’t use the mysql_(p)connect functions."

I searched for solutions on the web (no answers in this forum), and got several results that said to manually create the connection file such as the following

**************************************************************************

<?php

//Sample Database Connection Syntax for PHP and MySQL.

//Connect To Database

$hostname="your_mysqlserver.secureserver.net";

$username="your_dbusername";

$password="your_dbpassword";

$dbname="your_dbusername";

$usertable="your_tablename";

$yourfield = "your_field";

mysql_connect($hostname,$username, $password) OR DIE ("<html><script language='JavaScript'>

alert('Unable to connect to database! Please try again later.');

history.go(-1);</script></html>");

mysql_select_db($dbname);

?>

Just fill in your password etc, save it as connectdb.php (or whatever), and include it at the top of the files that need to access the database. You could use an if statement to determine whether you were working locally or on GoDaddy.

*************************************************************************

I tried that, but it still won't connect. (My regular connection for just transferring files works fine).

Has anyone out there solved the GoDaddy database connection problem?

Frank



This topic has been closed for replies.

1 reply

June 11, 2010

Check php_info()to see which connector is enabled.

It should be either mysql or mysqli.

Since you are having problems with mysql, try to connect with mysqli connector.

If that won't solve your problem, email GD about your problem, and ask if any mysql connectors are enabled in your hosting plan.