# phpMyAdmin Connection Issue

**URL:** <https://forum.kirupa.com/t/phpmyadmin-connection-issue/322691>\
**Category:** programming\
**Created:** [May 30, 2011, 8:54pm UTC](https://forum.kirupa.com/t/phpmyadmin-connection-issue/322691 "2011-05-30T20:54:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CharlieAdams](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@CharlieAdams](https://forum.kirupa.com/u/CharlieAdams)\
**Post date:** [May 30, 2011, 8:54pm UTC](https://forum.kirupa.com/t/phpmyadmin-connection-issue/322691/1 "2011-05-30T20:54:54Z")

</div>

I am using a mac with Dreamweaver CS4, XAMPP and phpMyAdmin.

I cannot figure out why this code won’t work? Are some of the codes not compatible with my OS?

Every time I try and log in with the username and password I have entered in the database already I get my error message for leaving the fields blank: “Please enter username and password.”

\<?php

$username = $\_POST[‘username’];  
$password = $\_POST[‘password’];

if ($username&&$password)  
{

$connect =mysql\_connect(“localhost”,“root”,“password”) or die (“Couldn’t connect.”);  
mysql\_select\_db(“phplogin”) or die (“Couldn’t find db”);

}

else  
die (“Please enter a username and password.”);

?\>

Any help would be much appreciated.

Thank you, in advance.
