SkyRanger Posted March 2, 2013 Share Posted March 2, 2013 I am having problem with checking if a row exists with no errors being displayed: $queryged = "SELECT * FROM `gedcom` WHERE `client`='$loggedin' limit 1"; $resultged = $mysqli->query($queryged) or die($mysqli->error.__LINE__); while($rowged = $resultged->fetch_assoc()){ if ($rowged['client'] == 0 ) { echo "No"; } else { echo "<a href=\"client/".$loggedin."/personal/".$rowged['ged']."\">YES</a> Updated: ".$rowget['gedup'].""; } } Quote Link to comment https://forums.phpfreaks.com/topic/275132-check-if-row-exists/ Share on other sites More sharing options...
AyKay47 Posted March 2, 2013 Share Posted March 2, 2013 (edited) Since you are returning only 1 row, you do not need a while loop. A good debugging habit to get into is to also output the SQL statement and check for errors there. What output is being displayed? Edited March 2, 2013 by AyKay47 Quote Link to comment https://forums.phpfreaks.com/topic/275132-check-if-row-exists/#findComment-1416028 Share on other sites More sharing options...
Solution SkyRanger Posted March 2, 2013 Author Solution Share Posted March 2, 2013 Thanks for catching that AyKay47. Never even realized I left the while loop in there which caused the error. Removed it and it works fine. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/275132-check-if-row-exists/#findComment-1416030 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.