Error help.
Session start in Index.php. This is part of php.inc. Cannot figure out why I get the error on the query. I would appreciate any help.
<?php
$con = mysql_connect("localhost", "user", "password"
or die('Could not connect to server');
mysql_select_db("table", $con) or die('Could not connect to database');
$userid = ($_POST['userid']);
$password = md5($_POST['password']);
$query = "SELECT users WHERE userid = '$userid' AND password = '$password' ";
$result = mysql_query($query) or die("Unable to verify user because:" . mysql_error());
if (mysql_num_rows($result) > 0)
{
$_SESSION['valid_user'] = $userid;
echo "Your user account has been validated\n";
echo "<a href=\"index.php\">Home</a>\n";
}
?>