Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8105611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:12:43+00:00 2026-06-06T00:12:43+00:00

This is thoroughly confusing me. I am trying to gather very basic statistics on

  • 0

This is thoroughly confusing me. I am trying to gather very basic statistics on my site, namely how many hits I am getting per day.

In a superclass that every controller inherits I have this code.

    // log every hit
    if(STATISTICS == 'all')
    {
        $stat = new Statistic();
        $stat->ip = $this->_get_ip_address();
        $stat->save();
    }

I am loading the spark before this block. I do have a table setup named Statistics. I have the Model file created named Statistic with a classname of Statistic. Everything works well except when I try to save.

I can print out the $stat object and it returns an Active Record Object with everything set up properly. But for some reason when I try to call $stat->save(); every page just returns an Internal Server Error.

I have not added a new Model to my site in a while so I may have forgotten something, but this is really bugging me.

Anyone have any ideas?

More Information:

My Statistic Model:

class Statistic extends ActiveRecord\Model {

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:12:44+00:00Added an answer on June 6, 2026 at 12:12 am

    It seems that nothing was wrong with my code at all. It all works beautifully.

    Protip: Don’t forget to set your id to auto increment in the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I'm thoroughly stumped on this one. I'm trying to build a menu of
I've searched the site thoroughly and Googled for this as well, but to no
First let me say I have read this useful article thoroughly and am using
this my first shot at this awesome new (to me) programmers site, I hope
I thought I had this sorted, but I am still missing something. Very simply,
I have searched quite thoroughly on this but can't seem to find an answer.
Im new to .NET web services and am thoroughly confused with this issue. TCP
Eric Lippert's comments in this question have left me thoroughly confused. What is the
This section has me thoroughly confused. I have an example problem that I am
Apologies if this has been covered thoroughly in the past - I've seen some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.