i've writen a php program to fetch array from mysql ..
however this line has error...
if ($row = mysql_fetch_array($result)){
it is a simple fetch result and i can't find out the bug....
anyone can help me??
the error message is:
Warning: Supplied argument is not a valid MySQL result resource in /home/clc/www/html/login.php on line 11
Warning: Cannot add header information - headers already sent by (output started at /home/clc/www/html/login.php:11) in /home/clc/www/html/login.php on line 22
the programe is:
<?php
require 'common.inc' ;
$query="select * from user where name='$user' and password='$password';";
mysql_connect($host,$user,$password);
mysql_select_db($database);
$query = stripSlashes($query);
$result = mysql_query($query);
if ($row = mysql_fetch_row($result)){
if($row[3]==3){
header("Location:paullink.php?$level=3");
exit();
}
else if($row[3]==4){
header("Location:paullink.php?$level=4");
exit();
}
}
else{
header("Location:paullink.php");
exit();
}
?>