Xtremer360 Posted December 18, 2010 Share Posted December 18, 2010 I have no idea why but no matter what the eventid is, the label always returns 20 and I"m not sure why. Is my synatx wrong? $eventid = (int)$_GET['eventid']; $result = mysqli_query($dbc, "SELECT count(label) FROM `events` WHERE `event_id` = '$eventid'"); $label = $result + 1; echo $label; Quote Link to comment https://forums.phpfreaks.com/topic/222030-using-count-function/ Share on other sites More sharing options...
MMDE Posted December 18, 2010 Share Posted December 18, 2010 $result = mysqli_query($dbc, "SELECT count(label) AS labelcount FROM `events` WHERE `event_id` = '$eventid'") OR die(mysqli_error($dbc)); what do you need to use it for? Quote Link to comment https://forums.phpfreaks.com/topic/222030-using-count-function/#findComment-1148864 Share on other sites More sharing options...
trq Posted December 18, 2010 Share Posted December 18, 2010 How do you know it returns 20? Your not using the data retrieved properly. Quote Link to comment https://forums.phpfreaks.com/topic/222030-using-count-function/#findComment-1148868 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.