I see 3 database names...
In your post you say it's easyflas_testdb, in the php files it's easyflas_spoonodb and spoono_db. Are you sure that's correct!
Besides that, you are making a lot of thinking mistakes. The first:
code:
<?
error_reporting(E_ALL);
//replace username and password with your mysql name and password
$conn = mysql_connect("localhost","easyflas_zaher19","okk");
//select the database
$db = mysql_select_db("easyflas_spoonodb");
$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
//insert the values
$result=mysql_query("INSERT INTO users(`id`,`username`,`password`,`email`) VALUES ('', '" . $username . "', '" . $password . "', '" . $email . "')");
if($result) {
echo "Your name and password have been submitted into our database ";
}
else {
echo "Error while inserting: " . mysql_error();
}
?>
The second:
code:
<?
error_reporting(E_ALL);
$conn = mysql_connect("localhost","eastflas_zaher19","okk");
$db = mysql_select_db("spoono_db");
$username = $_POST["username"];
$password = $_POST["password"];
$result = mysql_query("SELECT * from users WHERE username='" . $username . "' ABD password='" . $password . "'")
or die ("Error in your query: " . mysql_error());
if(mysql_num_rows($result) > 0) {
$worked = mysql_fetch_array($result);
$username = $worked['username'];
$password = $worked['password'];
$email = $worked['email'];
echo "Welcome $user! Your e-mail address is $email";
}
else {
echo "No username / password match found!";
}
?>
And off course first look at the database names. This should work...