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

The Archive Base Latest Questions

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

I want WHERE data select with $find, but it(WHERE) not work in following query

  • 0

I want WHERE data select with $find, but it(WHERE) not work in following query and my output is There is not, how fix it?

$find="hello";
$query = $this->db->query('
SELECT tour_foreign.name, 
       tour_foreign_residence.name_re, 
       tour_foreign_airline.name_airline, 
       tour_foreign.service, 
       tour_foreign.date_go, 
       tour_foreign.date_back, 
       tour_foreign.term 
FROM   tour_foreign 
       INNER JOIN tour_foreign_residence 
         ON ( tour_foreign.id = tour_foreign_residence.relation ) 
       INNER JOIN tour_foreign_airline 
         ON ( tour_foreign.id = tour_foreign_airline.relation ) 
WHERE  tour_foreign.name LIKE "%' . $find . '%" 
        OR tour_foreign_residence.name_re LIKE "%' . $find . '%"


');

if ($query->num_rows() > 0) {
    foreach ($query->result() as $val) {
        echo $val->name . '<br>';
    }
} else {
    echo 'There is not';
}
  • 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-26T09:28:21+00:00Added an answer on May 26, 2026 at 9:28 am

    You have an extra comma before the WHERE (after tour_foreign_airline.relation).

    Edit: I see you fixed it now, but the JOIN still looks wrong. Try this:

    INNER JOIN tour_foreign_residence
    ON (tour_foreign.id = tour_foreign_residence.relation)
    INNER JOIN tour_foreign_airline
    ON (tour_foreign.id = tour_foreign_airline.relation)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe this question is duplicate, but I can not find an answer for my
I'm beggining with MYSQL. I have the following query: SELECT answers.data. * , COUNT(
I want to select data between 1 week ago data until today data: SELECT
I have a database i want to select data from data base of current
I am new in share point. I want to select data using java script
Put simply, I want to select all data in two columns from each of
I want display data from database in Listbox...Here is my code, It is not
I have an NSString NSString *data = @abcdefghi; but I want the data to
I'm trying to produce a line chart using Flot, but I want the data
Maybe this is a shot in the dark here but I'm trying to find

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.