Undefined variable: rowAccount
Posted: Wed May 20, 2009 8:22 am
Please help me to fix error.
Error
Notice: Undefined variable: rowAccount in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\login.php on line 22
Code
Error
Notice: Undefined variable: rowAccount in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\login.php on line 22
Code
Code: Select all
<?php
require_once("connection.php"); // database connection
session_start();
// catch field data
$userid = (isset($_POST['userid']));
$password = (isset($_POST['password']));
$submitted = (isset($_POST['submitted']));
if ($userid && $password) {
//////////////////////////////////
$query =sprintf("SELECT * FROM users where user_name = '$userid' and user_password = '$password'");
$result =@mysql_query($query);
$rowAccount =@mysql_fetch_array($result);
/////////////////////////////////
echo $rowAccount;
}
if ($rowAccount){
$_SESSION['id'] = $rowAccount['user_id'];
header("location:welcome.php");
exit;
}elseif($submitted){
echo "You dont exists on our record";
}
?>