database link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jd57
Forum Newbie
Posts: 13
Joined: Tue Apr 21, 2009 8:04 am

database link

Post by jd57 »

Hi Everyone

I been trying to set a server on my computer and I'm very close to make it work, but I have a problem with link to my database.
On the script I use the following:

Code: Select all

$connection = mysql_connect('localhost','internb7_jxxx','xxxx') or die ("Couldn't connect to server."); 
$db = mysql_select_db('internb7_reg', $connection) or die ("Couldn't select database.");
Now I'm using a locathost with database name internb7 table ihsreg, I'm not using a user or password, what is the code to replace to be able to link to my database?
dhenick
Forum Newbie
Posts: 19
Joined: Tue Oct 20, 2009 10:46 am
Location: Yogyakarta, Indonesia
Contact:

Re: database link

Post by dhenick »

the default installation for mysql database is no password,
if you want to link database connection may be you can try

Code: Select all

 
$connection = mysql_connect("localhost","root","")or die(mysql_error());
$db_select =mysql_select_db('internb7_reg', $connection) or die ("Couldn't select database.");
 
jd57
Forum Newbie
Posts: 13
Joined: Tue Apr 21, 2009 8:04 am

Re: database link

Post by jd57 »

thank you so much
Post Reply