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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:25:11+00:00 2026-06-13T21:25:11+00:00

I’m having a hard time again in my query for codeigniter. First of all

  • 0

I’m having a hard time again in my query for codeigniter. First of all I read about this tutorials to base the work I’m doing in current: http://ellislab.com/codeigniter/user_guide/tutorial/news_section.html

Now what I do is something like this for the model function for my database:

public function get_events()
    {
            $id = $this->session->userdata('id');
            $this->db->flush_cache();
            $this->db->select('event_id');
            $this->db->select('event_name');
            $this->db->select('event_date');
            $this->db->select('event_time');
            $this->db->select('event_count');
            $this->db->select('event_max');
            $this->db->select('status');
            $query = $this->db->get_where('event_details',array('bar_id' => $id));
            return $query->row_array();
    }

And now to pass the values in my controller I use this line of code:

$data['events'] = $this->events_model->get_events();

And for the view I use this:

<table class="events_list">
<?php foreach ($events as $events_info): ?>
    <tr>
        <td>
            <input type="hidden" value="<?php echo $events_info['id'] ?>">
            <?php echo $events_info['event_name'] ?>
        </td>
        <td>
            <?php echo $events_info['event_date'] ?>
        </td>
        <td>
            <?php echo $events_info['event_time'] ?>
        </td>
        <td>
            <?php echo $events_info['event_count'].'/'.$events_info['event_max'] ?>
        </td>
        <td>
            <?php echo $events_info['status'] ?>
        </td>
    </tr>
<?php endforeach ?>
</table>

I’m supposed to get a return of:

(hidden)1 | Silverstein Concert | 2012-07-11 | 18:00:00 | 0/500 | 1

but instead I get a return of

1 | 1 | 1 | 1/1 | 1 

Well I haven’t displayed the whole return but this is supposed to have a 7 rows which all has a strange 1 character returns (next row contains full of S). I can’t tell where the problem really is since when I use

$data['test']=$data['events']['event_name'];

in my controller and displays it on my view the event name displays but only the first row data is repeating 7 times. Well I just need to solve this so that I can move on. Thanks!

  • 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-13T21:25:13+00:00Added an answer on June 13, 2026 at 9:25 pm

    If you can get the event name using $data['events']['event_name'], it means $data[events] contains a single row. Remove the foreach from your view and try with $events['event_name'], $events['event_date'] etc.

    row_array returns only a single row from your result set.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.