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'].""; } } 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 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? Link to comment https://forums.phpfreaks.com/topic/275132-check-if-row-exists/#findComment-1416028 Share on other sites More sharing options...
SkyRanger Posted March 2, 2013 Author 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. Link to comment https://forums.phpfreaks.com/topic/275132-check-if-row-exists/#findComment-1416030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.