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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:27:38+00:00 2026-05-26T05:27:38+00:00

I want get from database table row name but in it i get error.

  • 0

I want get from database table row name but in it i get error. ($query->code_airline => is other query as select from database table row)

code:

<?=$this->db->get_where('ticket_code', array( 'code' => $query->code_airline ))->row()->name?>

error:

A PHP Error was encountered
Severity: Notice
Message: Trying
to get property of non-object
Filename: core/Loader.php(679) :
eval()’d code
Line Number: 48

If want use it as:

<?php //This is line 49
    $ca = echo $query->code_airline;
    $query_tc = $this->db->get_where('ticket_code', array( 'code' => $ca ))->row();
    echo $query_tc->name;
?>

have this error:

Parse error: syntax error, unexpected T_ECHO in
D:\xampp\htdocs\system\core\Loader.php(679) : eval()’d code on line 49

How can fix it?

Update:

i use as:

<?php
    $ca = $query->code_airline;
    $query_tc = $this->db->get_where('ticket_code',array('code'=>$ca));
    $row = $query_tc->row(); //This is line 52
    echo $row->name;

?>

i have this error with above php code:

A PHP Error was encountered
Severity: Notice
Message: Trying
to get property of non-object
Filename: core/Loader.php(679) :
eval()’d code
Line Number: 52

  • 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-26T05:27:39+00:00Added an answer on May 26, 2026 at 5:27 am

    You don’t ECHO in a variable assignment

     $ca = $query->code_airline;  //no echo here!
    

    Also, I believe you’re doing something wrong in calling $query->code_airline, but you didn’t provide your code so I’m just guessing.

    Suggestion: chaining is a nice feature but can be confusing, especially if written as one-liner. First of all, write it in full, you can “compact” your code later if you feel so; keep in mind readability and maintenability also:

    $query_tc = $this->db->get_where('ticket_code',array('code'=>$ca));
    // $ca is the value assigned above. Make sure you're calling $query->code_airline correctly, as per my suggestion.
    $row = $query_tc->row();
    echo $row->name;
    

    UPDATE:
    you might want to be sure that there are actually any result.

       $query_tc = $this->db->get_where('ticket_code',array('code'=>$ca));
       // $ca is the value assigned above. Make sure you're calling $query->code_airline correctly, as per my suggestion.
       if ($query_tc->num_rows() > 0)
       {
         $row = $query_tc->row();
         echo $row->name;
       }
       else
       {
         //do something else
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code lets you search for a table name in an Oracle database. then
I insert data with json_encode() in database, now i want get( select * from
Using Access 2003 I want to get a table value from the two databases
Suppose you want to get a record from database which returns a large amount
I want to get an object from the database if it already exists (based
I want to get all conflict documents from a Notes database. So far, i've
I want to get a url from a string. Heres my code to extract
I'm trying to create an html table from database records. I want the table
My method loads a list of countries(code, name) into the database, but before that
I have a query that selects all the information from a database table and

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.