I don't want to discourage you, but what you're asking is far more involved than any forum post can cover.
You can't even begin to think about creating a login system and a shopping card system youself until you've become very comfortable with basic to intermediate PHP and MySQL.
You might find that a website based on Joomla or Drupal would be more suitable for you. You'll find the login system is included and there are many extensions available for things like shopping carts.
scaiferw
Junior Poster in Training
85 posts since May 2010
Reputation Points: 25
Solved Threads: 6
Here is a much more straightforward way to connect to your database:
// connect to database server
$dbserver = "localhost";
$username = "username";
$password = "password";
$connect = mysql_connect ("$dbserver", "$username", "$password")
or die ('I cannot connect to the database because: ' . mysql_error());
// select the database
mysql_select_db ("database_name") or die('I could not select database: '.mysql_error());
Localhost is probably the correct value for $dbserver.
As installed, there will only be one account, the 'root' account for MySQL. This should only be used for administration - it is extremely powerful and should not be used by a website to access the database. Set up a more restricted account for your web applications (websites) to use.
From what I can see in Google, there is no root password for MySQL on XAMPP as installed. See the links below. You should ensure that a password is set for this right away. http://veerasundar.com/blog/2009/01/how-to-change-the-root-password-for-mysql-in-xampp/
http://robsnotebook.com/xampp-remove-default-users-passwords
(By the way, when you're asking for help here, be sure to note what operation system and version you're running on your server.)
scaiferw
Junior Poster in Training
85 posts since May 2010
Reputation Points: 25
Solved Threads: 6