- Joined
- Feb 10, 2008
- Messages
- 30
- Reaction score
- 0
PHP:
<?
/* Created by: VoilACMS Team */
//Require the database connector
require_once("includes/db_fns.php");
//Start session
session_start();
//Define variables
$username = strip_tags($_POST['username']); #Strip HTML Tags
$password = sha1($_POST['password']); #SHA1 Encryption
//Select stuff from the users "profile" based on the username and password
$sql = "SELECT * from `user` where `username` = '$username' and `password` = '($password')";
$result = mysql_query($sql);
$fetch = mysql_fetch_array($result);
if($fetch)
{
echo "Good";
}
else
{
echo "Bad";
}
?>
There it is. Its just to check if the username and password exists in the database. But I always get an error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/*******/public_html/check.php on line 19
Any suggestions?

