ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Using MySQL from PHP
Subject:   Connect to MySQL DB
Date:   2009-06-22 20:04:54
From:   mfoster978
Response to: Connect to MySQL DB

I need help. I have been working on my site for days now and am having a problem. I am receiving an error saying the script could not connect to my sql. My script seems perfectly fine but it won't connect. Also I am using godaddy and a windows hosting account. Is there a chance it won't connect unless I change to linux?


My script is below:



<?
/**
* Connect to the mysql database.
*/
$conn = mysql_connect("p3nlmysqladm001.secureserver.net:", "loginform978", "************") or die(mysql_error());
mysql_select_db('loginform978', $conn) or die(mysql_error());


?>


I have also tried this:
<?
/**
* Connect to the mysql database.
*/
$conn = mysql_connect("p3nlmysqladm001.secureserver.net:3306", "loginform978", "************") or die(mysql_error());
mysql_select_db('loginform978', $conn) or die(mysql_error());


?>


Please help me. If you need to please contact me at mike_foster@tmail.com.


Thanks,
Mike Foster


1 to 1 of 1
  1. Connect to MySQL DB
    2009-07-05 20:17:09  Reloaded2010 [View]

1 to 1 of 1