Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

PHP MySql connection to GoDaddy

New Here ,
Jun 10, 2010 Jun 10, 2010

Copy link to clipboard

Copied

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



TOPICS
Server side applications

Views

2.2K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 10, 2010 Jun 10, 2010

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines