PHP difficulties connecting MyAdmin MySQL database to site hosted by DreamHost -


i having difficulty code have written, not connect sql database site.

i have made website on dreamweaver, , public , hosted dreamhost.

i have logged 'mysql database management of dreamhost' , created database multiple tables.

i have since created php script connect database site , have uploaded site. following example of script:

"

   $db_host="andrewsmith.com";     $db_username="andrews";     $db_pass="*******";    $db_name="database345";     @mysql_connect("$db_host", "db_username", "$db_pass") or die ("could not connect     mysql");      @mysql_select_db("$db_name") or die ("no database");     echo ("successful connection"); 

?> "

however, issue page shows message "could not connect mysql". coding problem, can't see have gone wrong. have suggestions?

thanks considering question

james

a dreamhost database uses subdomain point actual mysql instance. there-for fix adding mysql.domainname.com. can find correct database hostname in dreamhosts cpanel under databases.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -