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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:50:27+00:00 2026-05-31T12:50:27+00:00

I have a image hosting site in CI with an image view file (working

  • 0

I have a image hosting site in CI with an image view file (working well) and an image album one, however the album view is producing the following error ‘Trying to get property of non-object’. I’ve tried searching but cant see what I’m doing wrong.

The area in my view which has this issue is (this line ‘if($row->id == $id_array[$key]):’):

<?php if(count($records_array) != 1) : ?>
<div class="album-images">

<?php $i = 0; $links_array = array(); ?>
    <?php foreach ($records_array as $key => $records) {
    if(isset($records)) : foreach($records as $row) : ?>

        <?php if($row->id == $id_array[$key]):   ?>
        <?php $i++; ?>
        <?php

        //get array of ids for linking
        foreach ($id_array as $key => $ids) {
            array_push($links_array, alphaID($id_array[$key]));
        }

My other view has the exact same code which is why it’s so strange.

Here’s the content of records_array[] : http://pastebin.com/6pyTCBSH

And the id_array[] (contains the album images id’s)

Array
(

    [0] => 2738
    [1] => 2758
)

The records_array is used at the top of the file is that’s relevant http://pastebin.com/yF2yXrxK

Can anyone see why this is happening? The error outputs about 25-30times down the page.

  • 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-05-31T12:50:28+00:00Added an answer on May 31, 2026 at 12:50 pm

    The error “Trying to get property of non-object” mean that you’re trying to access a variable or method on something that isn’t an object. In this case, you’re trying to access the variable id from $row, but $row isn’t an object.

    Depending on where the data comes from, perhaps it’s an array, in which case you should access the id property as $row['id'].

    In case this fails as well, I’d suggest you do print_r($row) to figure out what exactly $row contains.

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

Sidebar

Related Questions

I have image and txt file of same size say 200 KB. Now i
My site needs to have image based posts, meaning the post is only an
I have a problem... In my view i have Image.If i click on image
I am working on optimizing one of the SQL Job. Here I have few
In Google App Engine free 1GB bandwidth hosting website if we have external image
I have 2 asp.net mvc2 projects in a solution. One is normal site for
I have a image hosting server, and i run multiple blogs were most of
i have this inside my site.css file (in the COntent directory) body { width:
I'm getting this error when uploading an image on my hosting. Request for the
I have image data and i want to get a sub image of that

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.