How do you connect to the phpmyadmin databases

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

How do you connect to the phpmyadmin databases

Postby bcurtis » 12. July 2010 17:00

I have just downloaded XAMMP and I am having trouble with connecting to my local database when I write my php pages.
this is an example of my connect.php page that I am using to connect to this local database.

<?php
$dbUserName="username";
$dbPassword="password";
$db="databaseName";
$link = mysql_connect('WHAT NAME GOES HERE??', $dbUserName, $dbPassword);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db($db);

?>
bcurtis
 
Posts: 1
Joined: 12. July 2010 16:27

Re: How do you connect to the phpmyadmin databases

Postby MegaChriz » 12. July 2010 18:00

Code: Select all
localhost

http://php.net/mysql_connect

The first parameter of the function mysql_connect() is the server you want to connect to. Most of the times this is 'localhost', even with hosting providers.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 80 guests