daveoffy Posted December 23, 2008 Share Posted December 23, 2008 I have a database table called message and I want to make a echo display how many messages I have. If you need any more info please reply i will be happy to give you it. Quote Link to comment https://forums.phpfreaks.com/topic/138219-number-of-messages/ Share on other sites More sharing options...
revraz Posted December 23, 2008 Share Posted December 23, 2008 Post what you have so far. Quote Link to comment https://forums.phpfreaks.com/topic/138219-number-of-messages/#findComment-722597 Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 We would need to see your code like revraz said but it would go something like this: $sql = "SELECT your_field FROM your_table WHERE your_id = your_id"; $result = mysql_query($sql) or die(mysql_error()); $num_messages = mysql_num_rows($result); echo "You have: " . $num_messages; Quote Link to comment https://forums.phpfreaks.com/topic/138219-number-of-messages/#findComment-722609 Share on other sites More sharing options...
daveoffy Posted December 23, 2008 Author Share Posted December 23, 2008 Maq you are right it works. Thanks (no need for code now) Quote Link to comment https://forums.phpfreaks.com/topic/138219-number-of-messages/#findComment-722615 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.