so, this file was working on my local computer, which runs php 4.3 and apache 2.0, and then I uploaded it to the web server which is apache 1.3 and uses php 4.2.2 and I got this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /test/auth.php on line 24
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /test/auth.php on line 48
Warning: Cannot add header information - headers already sent by (output started at /test/auth.php:24) in /test/auth.php on line 49
<?
$db = mysql_connect("localhost", "xxxxxx", "xxxxx") or die("couldn't connect to database");
mysql_select_db("xxxxxxx",$db) or die("couldn't select db");
session_name("");
session_start();
if (!$username || !$password || !$username && !$password)
{header("location:index.php");}
if ($username && $password)
{
//if the user has just tried to log in
$query = "select * from tblLogin where lgnUserName='$username' and lgnPassword='$password'";
$result = mysql_query($query, $db);
if (mysql_num_rows($result) > 0)
{
//if they are in the database register the user id
$login_array = @mysql_fetch_array($result);
$session_sessid = $login_array["lgnFanclubNo"];
$session_valid_user = $username;
session_register("session_valid_user", "session_sessid");
$olduser_query = "select * from tblInfo where infFanclubno = '$session_sessid'";
$olduser = mysql_query($olduser_query);
if(mysql_num_rows($olduser) > 0) {
header("Location:member_directory.php");
}else{
header("Location:edit_profile.php?fanclubno=$session_sessid");
}
} elseif (mysql_num_rows($result) == 0)
{ header("Location:index.php"); }
}
?>
could anyone tell me where I screwed up? I appreciate any help.