View Single Post
  #17 (permalink)  
Old 03-06-08, 04:36
Rodricks Rodricks is offline
BOD Member
 
Join Date: Jul 2007
Posts: 128
Default

Sometimes a webhosting provider will require you to specify the MySQL server name and port number.
For example if the MySQL server name is db.php-mysql-bodhost.com and the port number is 3306 then you you can modify the above code to :

HTML Code:
<?php
$dbhost = 'db.php-mysql-bodhost.com:3306';
$dbuser = 'root';
$dbpass = 'password';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');

$dbname = 'petstore';
mysql_select_db($dbname);
?>
Reply With Quote