• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

How can I fix this connect File?

I can't figure out why this will not connect.
<?
$con = mysql_connect("p41mysql111.secureserver.net","jaruano","H0tstuff101");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("jaruano", $con);
?>

Open in new window

0
phpretard
Asked:
phpretard
1 Solution
 
shobinsunCommented:
HI,

try:

<?
$con = mysql_connect("localhost","jaruano","H0tstuff101");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("jaruano", $con);
?>
0
 
cdaugustinCommented:
hi, ive got three things to say:

first: never copy/paste code that contains real usernames and passwords into forums (replace them with giberish text)

second: shobinsun is saying  if you are connecting to a local mysql server you probably need to use "localhost" rather than "p41mysql111.secureserver.net" if you dont connect to a local mysql server then check permisions on the mysql user.

third: id recommend changing that password (and even username)
0
 
phpretardAuthor Commented:
Thanks
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now