Possible Duplicate:
Why do I keep getting a 500 error with my PHP?
I am creating a page that allows a user to login to the website. I keep getting a 500 error. Here's the code that gives me an error:
<?php
if(isset($_POST['submit']))
{
    $username = $_POST['username'];
    $password = $_POST['password'];
    include( 'connection.php' );
    if(empty($username) || empty($password))
    {
        $error = 'Please enter your username and password'
    }
    else
    {
        $password = md5($password);
        $sql = mysql_query("SELECT * FROM users WHERE username = $username AND password = $password LIMIT 1") or die(mysql_error)();
        $num_rows = mysql_num_rows($sql);
        if($num_rows == 1)
        {
            $fetch = mysql_fetch_array($sql);
            extract ($fetch);
            echo $username;
        }
        else
        {
            echo 'There was an error while logging in'
        }
    }
?>
 
     
     
     
    