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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:31:28+00:00 2026-05-26T01:31:28+00:00

I am trying to display data from db. It displays this error <p>Severity: Notice</p>

  • 0

I am trying to display data from db. It displays this error

  <p>Severity: Notice</p>
  <p>Message:  Trying to get property of non-object</p>
  <p>Filename: controllers/schedule.php</p>
  <p>Line Number: 57</p>

  <p>Severity: Notice</p>
  <p>Message:  Trying to get property of non-object</p>
  <p>Filename: controllers/schedule.php</p>
  <p>Line Number: 58</p>

here is my code in controller which, this code is related to this problem

$data['rows'] = $this->Model_scheduleSave->save_schedule($data);
$this->load->view('home_view',$data);

here is my view

if($rows) {
            //var_dump($rows);
            foreach(rows as $r) : 
                "<div>". $r->client_url ."</div>";
                "<div>". $r->admin_url ."</div>"; 
            endforeach;
        }

here is my model

public function save_schedule($data) {
    $query = "INSERT INTO schedule VALUES('',?,?,?,?,?,?,?)";
    $result = $this->db->query($query,$data);
    if($result) {
        $get_urls = "SELECT client_url,admin_url FROM schedule ORDER BY id DESC LIMIT 1";
        $results = $this->db->query($get_urls);
        if($results) {
            foreach($results->result() as $rows) {
                $data[] = $rows;
            }
        }
        return $data;
    } else {
        return false;
    }
}

Where am I making mistake?

  • 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-26T01:31:28+00:00Added an answer on May 26, 2026 at 1:31 am

    In case your database query returns no result, the function will return the parameters passed to the function ($data). That might cause your error.

    Another word of notice: Don’t re-use variable names. You use $data to pass parameters to your function in the controller, and afterwards you assign the result to $data['rows']. You should use two variables, one for the view variables, and one for the function parameter.

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

Sidebar

Related Questions

I'm trying to get ReportViewer to display data from a BindingSource (VB.Net Winforms). I
I am trying to get some data to display from an Array in Cakephp,
Im trying to get data from a mysql database and display it in an
I am trying to have a tree display custom data that looks like this.
I'm trying to use WebGrid HtmlHelper to display data from a few entities. The
Im trying to return a list to a display template containing data from two
I'm trying to display data from an array of objects obtained using another company's
I'm trying to get some code going that lets me display raw trackpad data
I am trying to display data from my database to a Jsp page using
I am trying to display some data from mySQL, the db details are correct

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.