I'm having a problem here , I needed to read a value from my database to check if the profile is completely completed.Somehow information was not fetched from the database. I tried to fetch other information as well , but no values were returned. There were no errors when i ran the codes.
Any pros care to help me ?? 😕
<?PHP
$query = "select * from register where uname='$uname'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_assoc($result)) {
echo $row["completed"];
$completed = $row["completed"];
}
if($completed == 0){
// profile not complete , complete page first before proceeding
echo '<meta http-equiv="Refresh" content="0.1;url=completeRegister.php">';
}else {
//profile is completed, go to home page
echo '<meta http-equiv="Refresh" content="2;url=home.php">';
} ?>