ecabrera Posted March 6, 2013 Share Posted March 6, 2013 How would i display the count in mysqli $pagesql = "SELECT COUNT('id')FROM `orders`"; $result = mysqli_query($db,$pagesql); I have try echoing out the mysqli_num_rows but i get one Quote Link to comment https://forums.phpfreaks.com/topic/275336-select-count/ Share on other sites More sharing options...
Solution Jessica Posted March 6, 2013 Solution Share Posted March 6, 2013 1. Put a space after the ). 2. Use a column name, not a string. 3. Give it an alias: COUNT(id) AS orders_count 4. Fetch the row. Quote Link to comment https://forums.phpfreaks.com/topic/275336-select-count/#findComment-1417002 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.