View Single Post
  #1 (permalink)  
Old 20-08-2008, 15:16
comports comports is offline
Member
 
Join Date: May 2008
Posts: 30
Default Really Stupid Question

OK All,

Starting off with MySql and have a really stupid question. I have a DB set up but can't seem to even get the connection right...

I have a page that I want to connect to the DB and just say ok but it does not work.. I ave an incling that it's the "localhost" bit but could be wrong..!!

Code:
<?php 

 $link=mysql_connect("localhost", "ash", "jessica1");
	if(mysql_select_db("mysql", $link)) echo "connected to DB";
		Else die ("Connection failed");
?>
Could someone let me into the secret of connecting to my DB.

Thanks
Ash
Reply With Quote