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

  • SEARCH
  • Home
  • 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 7896753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:58:32+00:00 2026-06-03T07:58:32+00:00

I have a db with events from a event table that selects a eventid,

  • 0

I have a db with “events” from a event table that selects a eventid, year,month,day from my database in order to create dynamic links in a calendar.

Here is my controller:

$this->load->model('Sitemodel');
$month=date('n');
$year=date('Y');
$datearray=$this->Sitemodel->get_dates($month,$year);

$baseurl=base_url('site/event').'/';
foreach ($datearray as $datee) {
       $dateeday=$datee['dtDay'];
       $datacalendar[$dateeday]= $baseurl.$datee['eventid'];
}
$data['calenderinfo']=$this->calendar->generate($year,$month,$datacalendar);
$data['events']=$this->Sitemodel->get_10_all_events();

$this->load->view('index',$data);

here is my model:

function get_dates($month,$year){
   $sql="SELECT eventid, DAY(dateof) AS dtDay, MONTH(dateof) AS dtMonth, YEAR(dateof) AS dtYear FROM event WHERE MONTH(dateof)=? AND YEAR(dateof)=?";
   $result=$this->db->query($sql,array($month,$year));
   return $result->result_array();
}

the error im getting is :

A Database Error Occurred

Error Number: 1054

Unknown column 'date' in 'order clause'

SELECT * FROM (`event`) ORDER BY `date` desc LIMIT 10

Filename: C:\wamp\www\event\system\database\DB_driver.php

Line Number: 330

I am unable to debug the error since it links back to the DB_driver when I know it must be something within my controller/model.

my DB structure for event table (names of columns) is:

eventid,eventtype,description,dateof(which is a date type)

I normally could figure this out if the error line of my controller/model/view is shown but instead it shows a error at the system level which totally throws me off. any help is greatly appreciated. Thank you.

  • 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-03T07:58:34+00:00Added an answer on June 3, 2026 at 7:58 am

    The query that is producing the error, is happening somewhere other than the code you posted. It might be generated from a model call based on your schema file. Check your schema file and see if it has a date reference instead of dateof.

    This is one of the dis-advantages of an ORM, you can edit the schema all day, but if you don’t update the schema config file, and rebuild the model, all sorts of things can break.

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

Sidebar

Related Questions

I have a QTableView that I need to get the selectionChanged event from. I
I have a local thread that is started on button-click event from the main
I have an event handler that will remove an element from a list of
I have a button click event that takes information from controls and enters it
I want to include a table (Events) from another database in my LINQ to
I have a database with two tables, events and tickets . The events table
I have two entities: Event and Comment. @Entity @Table(name = events) public class Event
I have a sql server 2008R2 with a database that have table with thousands
I have a table that contains events, to list these events I loop through
do routed events from wpf have something in common with the chain of responsibility

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.