Connecting to Godaddy DB
Well as hard as I have tried to avoid it, I am now having to work on a website hosted by Godaddy. Not a fan of Godaddy at all.
So I have been successful at creating a DB and table. I can Log into phpmyadmin and see it there.
I have gotten my connection info. But I always get MySQL Error #2002.
Within Dreamweaver here is an example of my options:
Connection Name: SkinnyDB
MySQL server: SkinnyPixel.db.XXXXXXX.hostedresource.com
User name: SkinnyPixel
Password: xxxxxx
In Godaddy Database details they give a code example:
<?php
//Variables for connecting to your database.
//These variable values come from your hosting account.
$hostname = "SkinnyPixel.db.XXXXXXX.hostedresource.com";
$username = "SkinnyPixel";
$dbname = "SkinnyPixel";
//These variable values need to be changed by you before deploying
$password = "your password";
$usertable = "your_tablename";
$yourfield = "your_field";
//Connecting to your database
mysql_connect($hostname, $username, $password) OR DIE ("Unable to
connect to database! Please try again later.");
mysql_select_db($dbname);
//Fetching from your database table.
$query = "SELECT * FROM $usertable";
$result = mysql_query($query);
if ($result) {
while($row = mysql_fetch_array($result)) {
$name = $row["$yourfield"];
echo "Name: $name<br>";
}
}
?>
Need to connect to use PowerCMS, Newsletter, DataAssist, etc.