Jump to content

Recommended Posts

I'm trying to get mysql connections to work in dreamweaver (i've managed to get it to work manually, but I can't get any response from dreamweaver).

 

Dreamweaver creates this connection file (I haven't tested to see if it works)

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_thegeneral = "mysql57.secureserver.net";
$database_thegeneral = "thegeneral";
$username_thegeneral = "thegeneral";
$password_thegeneral = "********";
$thegeneral = mysql_pconnect($hostname_thegeneral, $username_thegeneral, $password_thegeneral) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

 

The code I used to test the connection with (I tested this and even tried replacing dreamweavers code with it)

<?php
$hostname="mysql.secureserver.net";
$username="thegeneral";
$password="********";
$dbname="thegeneral";
$usertable="authentication";
$yourfield = "user_name";
mysql_connect($hostname,$username, $password) OR DIE (" ");
mysql_select_db($dbname);

# Check If Record Exists

$query = "SELECT * FROM $usertable";

$result = mysql_query($query);

if($result)
{
while($row = mysql_fetch_array($result))
{
$name = $row["$yourfield"];
echo "Name: ".$name."
";
}
}
?> 

 

The code I used to replace dreamweavers connection file with

$hostname="mysql.secureserver.net";
$username="thegeneral";
$password="********";
$dbname="thegeneral";
$usertable="authentication";
$yourfield = "user_name";
mysql_connect($hostname,$username, $password) OR DIE (" ");
mysql_select_db($dbname);

 

The error message dreamweaver gives when i try to test the connection in dreamweaver

error1hu.jpg

 

I don't understand y it isn't working :(

Whats the reason for the 404 error and whats this MMHTTPDB.php file it mentions in the error message? I've tried everything i can think of to fix this problem but I just can't make a connection in dreamweaver. Thank you for your help.

Link to comment
https://forums.phpfreaks.com/topic/2466-mysql-connection-help-me-please/
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.