-
Member
Connection to mysql at Earthlink
I am reading and eventually will begin contributing to the awesome forum. I am requesting some assistance in setting up my connector in NOF12 I assume I would use a custom connection and I am assuming I would enter the table name and fields in the parameter field in the advanced connection window. The following PHP script is used to connect to mysql on Earthlink. Any assistance would be appreciated.
<?php
// Connect to database
$hostname = "mysql126.hosting.earthlink.net";
$username = "moorescorner";
$password = "your_password";
$dbname = "moorescorner";
$usertable = "your_tablename";
$yourfield = "your_field";
$yourfield2 = "your_field2";
mysql_connect($hostname, $username, $password) or DIE("Unable to connect to MySQL server $hostname");
print "Connected to MySQL server<br>";
$selected = mysql_select_db($dbname) or DIE("Could not select requested db $dbname");
print "Connected to database $dbname<br>";
$query = "SELECT * FROM $usertable";
$result = mysql_query($query) or DIE("Could not Execute Query on table $usertable");
if ($result) {
print "Query successful on table $usertable<br><br>";
print "Your Query returned:<br>";
while ($row = mysql_fetch_array($result)) {
print "".$row{$yourfield}." ".$row{$yourfield2}." <br>";
}
}
mysql_close;
?>
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules