I have recently decided to take the plunge and try my hand at php, Ia m enjoying it and I have so far created a login/logout and register page.

But I am having trouble with the forgot password script. Please can you help and be kind as it is my first time posting.
This is the error that i am getting Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
PHP Code:

if (isset($_POST['submit']))
mysql_connect("host"username", "password") or die("could not connect to the database");
db_name") or die("could not select database");

$username = $_POST['username'];
$email = $_POST['email'];

$sql = mysql_query("SELECT FROM `usersWHERE `username` = '$username' AND `email` = '$email'");
$result = mysql_num_rows($sql);

    if (!
        die (mysql_error());

    if (
$result == 1)
$rows = mysql_fetch_array($result);
$password = $rows['password'];
$email = $rows['email'];
$subject ="Password request";
$header = "fromomarmuzaffar@live.co.uk";
$body = "Your password is " . $password

        mail (
an email containning the password has been sent to you");
        echo ("
No such user exists in the systemPlease try again");



        forgot password form
        <form action = "
<?php $_SERVER['PHP_SELF'];?>" method = "POST">
                <label for = "username">Username:</label>
                <input type = "text" name = "username" />
                <label for = "email">Email:</label>
                <input type = "text" name = "email" />
                <input type = "submit" name="submit" />
                <input type = "reset" name = "reset" />