Jump to content

Noobie: Connecting to MySQL


ensanity

Recommended Posts

Hey there,

 

I'm pretty new to working with MySQL and PHP. I'm trying to connect to my database thats hosted on yahoo!.

 

When I go into phpMyAdmin the server says: www.urlhere.com

 

The PHP that i've tried using to connect are as follows:

 

<?php 
$Database = mysql_connect ("localhost", "usernamehere", "passwordhere") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db("bamboo" , $Database);
?>

 

and

 

<?php 
$Database = mysql_connect ("www.urlhere.com", "usernamehere", "passwordhere") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db("bamboo" , $Database);
?>

 

am I doing something incorrect? Or is yahoo! just whack?

 

 

Link to comment
https://forums.phpfreaks.com/topic/47514-noobie-connecting-to-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.