Question I guess is... How do I determin via a mysql query whether or not a database row has certain fields defined. If they do, have code do one thing, if they arn't defined, ahve the php code do another thing.
At this point, I need people who DONT have a first name last name and company defined in the database, be re-directed to vip-information.php after they login.
If they arleady have these fields, I need them to be redirected to vip-area.php
This is not working, anybody know why?:
Code: Select all
$query4 = "SELECT first_name, last_name, company FROM vip WHERE username='$_POST[username_register]'";
$result4 = mysql_query($query4);
if (mysql_num_rows($result4)<1){
session_start();
$_SESSION['Username'] = $_POST[username_register];
$_SESSION['Password'] = $_POST[password_register];
header ("Location: vip-information.php");
}else{
$query3 = "UPDATE vip SET password='$_POST[password_register]' WHERE username='$_POST[username_register]' LIMIT 1";
$result3 = mysql_query($query3);
session_start();
$_SESSION['Username'] = $_POST[username_register];
$_SESSION['Password'] = $_POST[password_register];
header ("Location: vip-area.php");
}
}else{
$error4 = "That account already has a Username and Password. Please Login";
}
}
}
}