[eluser]skunkbad[/eluser]
[quote author="lenwood" date="1270373678"]Hi All,
I'm in the process of building an app with CI. I'm rusty so as a starting point I've built a basic site with a couple of static pages, and I've added the blog per the video tutorial.
When I reached the last stages of the tutorial, where Derek uses an if statement to determine whether there have been any comments yet, that produces a fatal error for me, "Call to a member function num_rows() on a non-object in...". I did a few web searches, tried a couple of different things that I found in the forums, and nothing worked.
Just to see what would happen, I pulled the if statement out altogether (and its closing endif). Now the site works exactly the way its supposed to. If a post has no comments, nothing is displayed above the comment fields.
Before I do more research and try to fin the fatal error, is there a good reason to have that present if the app works without it?
Thanks,
Chris[/quote]
If there are no rows in a result, and you try to count them (remember they don't exist), then you get this error.