I'd want it to look like this. I found a script to download, which I uploaded to my server on HostGator. It gives this error: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/myusername/public_html/myurl.com/phpcommentbox/connect.php on line 2 mysql_error() this is what's in connect.php <?php $connect=mysql_connect('127.0.0.1:3307', 'myusername_comment', 'mypassword') or die('mysql_error()'); $database=mysql_select_db("comment") or die('mysql_error()'); ?> PHP: myusername_comment is the name of a database which was created. I know I could use Disqus as a comment box, but I don't think that would provide any SEO benefit. I say this because I checked the source code for a page with disqus comments once, and the comments weren't a part of the HTML. Isn't this what the spiders look for, what's in the HTML?
try: <?php $connect=mysql_connect('localhost:3307', 'myusername_comment', 'mypassword') or die('mysql_error()'); $database=mysql_select_db("comment") or die('mysql_error()'); ?> Code (markup):
I hope your query was solved, but if not then take a look... First create database and the user, and give the access to user to connect your database from your "cpanel"(your server). And here i've few examples for you... i hope it might helpful to you. /* //Simple connection. */ mysql_connect('localhost', 'myusername', 'mypassword'); /* //Example 1 */ define("HOST", "localhost"); define("DATABASE", "mydb"); define("USERNAME", "myusername"); define("PASSWORD", "mypassword"); @mysql_connect (HOST, USERNAME, PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error()); @mysql_select_db (DATABASE) OR die('Could not select the database: ' . mysql_error()); /* //Example 2 */ $connection=mysql_connect('localhost', 'myusername', 'mypassword') or die('mysql_error()'); $database=mysql_select_db('mydb') or die('mysql_error()'); /* //Example 3.1(using "function()"). */ function connection($hostname, $username, $password) { if (!mysql_connect ($hostname, $username, $password)) { die ('Could not connect to MySQL: ' . mysql_error() . "!"); } else { mysql_select_db($database) or die ('Could not connect to MySQL: ' . mysql_error() . "!"); echo 'Connected to My SQL!'; } } //Call your "connection" function. connection('localhost','myusername','mypassword'); /* //Example 3.2 (using "function()"). */ function connection($hostname, $username, $password, $database) { if (!mysql_connect ($hostname, $username, $password, $database)) { die ('Could not connect to MySQL: ' . mysql_error() . "!"); } else { mysql_select_db($database) or die ('Could not connect to MySQL: ' . mysql_error() . "!"); echo 'Connected to My SQL! Your Database "'.$database.'" has selected.'; } } //Call your "connection" function. connection('localhost','myusername','mypassword','mydb'); PHP: