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 7912919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:43:21+00:00 2026-06-03T13:43:21+00:00

Reference: http://www.grocerycrud.com/documentation/options_functions/set_model I have 2 tables like this: [tblFitnessClasses] id uid title description location

  • 0

Reference: http://www.grocerycrud.com/documentation/options_functions/set_model

I have 2 tables like this:

[tblFitnessClasses] id uid title description location

[tblFitnessClassDateTimes] owner_uid startDate endDate startTime
endTime days recurrence

Essentially I want the table to end up like this:

(uid - hidden)  | Title     | Description   | Location  | Start Date    | End Date     | Start Time | End Time | Days      | Reccurence
                Swim Lesson  Level 1         Gym         05/04/2012     NULL            12:30       1:30        Mon,Wed,Fri   2  

In part of my main controller I have this:

     function fitnessSchedule()
{
    $this->config->set_item('url_suffix', '');
    $crud = new grocery_CRUD();
    $crud->set_table('tblFitnessClasses');
    $this->load->model('schedule_model');
    $this->schedule_model->join_table('tblFitnessClasses','tblFitnessClassDateTimes');
    $crud->columns('title','description','location','startEventDate','endEventDate','startTime', 'endTime', 'days', 'recurrence', 'finalDate);
    $crud->display_as('title','Event')
         ->display_as('description','Description')
         ->display_as('location','Location')
         ->display_as('startEventDate','Start Date')
         ->display_as('endEventDate','End Date')
         ->display_as('startTime','Start Time')
         ->display_as('endTime','End Time');
    $crud->required_fields('title','location');
    $crud->set_subject('Event');             

    $output = $crud->render();
    $this->_example_output($output);     
}

In my model I have this:

    <?php
class schedule_model extends CI_Model
{
        public function join_table($table1,$table2)
        {
          $this->output->enable_profiler(TRUE);//Turns on CI debugging

          $this->db->select("*");
          $this->db->from($table1);
          $this->db->join($table2, $table1.".uid". "=".$table2.".owner_uid"); // Join classes and class date times by UID

          $results = $this->db->get()->result();
            return $results;
        }
}
?>

When I run this code I get a table with all of the required fields BUT the fields from table2 (tblFitnessClassDateTimes) are missing all information. The fields do not populate with its data. In addtion to this, if I chose to edit the table it only goes to edit able1(tblFitnessClassses)

enter image description here
enter image description here

  • 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-03T13:43:23+00:00Added an answer on June 3, 2026 at 1:43 pm

    You’re loading a model the wrong way. In fact, you’re not even loading one! You’re just creating a new instance of grocery_CRUD and not the model you wrote.

    $this->load->model('schedule_model');
    $this->schedule_model->join_table('tblFitnessClasses','tblFitnessClassDateTimes');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Website in reference: http://www.imvu-e.com/products/ht/clients/test/ Notice on the tables how I have a newline separating
when i search for open source for domain checker, i got this reference http://www.codeproject.com/KB/aspnet/DataScraping.aspx
Referring to this web site http://www.cplusplus.com/reference/std/utility/make_pair/ The std::make_pair has this signature (and possible implementation):
http://www.cplusplus.com/reference/algorithm/make_heap/ In this link. it says: Internally, a heap is a tree where each
Please take a look at this site as a reference: http://www.philsalesses.com/place-pulse/ On the left
Code as reference: http://jsbin.com/aboca3/2/edit In this example above (thank you SLaks) I am truncating
I'm working on visualizing a matrix in R (almost exactly like http://reference.wolfram.com/mathematica/ref/MatrixPlot.html ), and
From http://www.cplusplus.com/reference/stl/bitset/ : Because no such small elemental type exists in most C++ environments,
Reference: http://www.facebook.com/note.php?note_id=389414033919 They said they build it in PHP and Javascript, which is great,
Im coding a problem(reference --http://www.codechef.com/FEB11/problems/THREECLR/) The below is my code import java.io.*; import java.util.*;

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.