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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:48:17+00:00 2026-05-23T15:48:17+00:00

When I the search function, no matter what I get back all the entries

  • 0

When I the search function, no matter what I get back all the entries in the searched DB table.

This is the controller:

function search()
{
    $this->form_validation->set_rules('company', 'company field', 'required');

    $search_text = $this->input->post('name');
    $is_ajax = $this->input->post('ajax');

    $data['found_companies'] = $this->Company->get_companies_by_name($search_text);
$data['page_title'] = 'Search';

$this->load->view('head', $data);
    $this->load->view('pages/search', $data);
$this->load->view('footer');
}

this is the model function get_companies_by_name that does the search:

function get_companies_by_name($name) {

    $this->db->select('id,name,logo,phone,email,adress,url,contact,contact_phone,biz_id,join_date,user,password');
    $this->db->like('name', $name, 'after');

$returned = $this->db->get('companies');
return $returned;
}

and this is the view part that displays the search:

    <?php

validation_errors();

    echo form_open("pages/search",$attributes);
        echo form_input('company','');
        echo form_submit('submit','חפש');
        echo form_close();


        foreach ($found_companies->result() as $company) { ?>

                    <?= img("uploads/thumbs/" . $company->logo);?>
                    <?= $company->id; ?>
                    <?= anchor ("admin/home/$company->id", "$company->name</br>"); ?>
                    <?= $company->phone;?>
                    <?= $company->email;?>
                    <?= $company->adress;?>
                    <?= $company->url;?>
                    <?= $company->contact;?>
                    <?= $company->contact_phone;?>
                    <?= $company->biz_id;?>
                    <?= $company->join_date;?>
                    <?= $company->user;?>
                    <?= $company->password;?>
                    <?= anchor ("bizadmin/del/$company->id", "מחק עסק</br>")." ".anchor ("admin/edit/$company->id", "ערוך עסק</br>")." ".anchor ("admin/editcamp/$campaign_id->id", "ערוך קמפיין</br>"); ?>
                </br>

    <? } ?>
  • 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-23T15:48:18+00:00Added an answer on May 23, 2026 at 3:48 pm

    Try changing

        $search_text = $this->input->post('name');
    

    with

        $search_text = $this->input->post('company');
    

    in function search()

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

Sidebar

Related Questions

This is quite weird but my search function can search for any word except
I'm doing this system Stacked and I am creating the search function. And in
This is part of a search function on a website. So im trying to
The table name is 'pages'.. I need to make a search function, where I
My function is pretty much a standard search function... I've included it below. In
if i have a search function for my site and i want the user's
I have a problem using the Java search function in Eclipse on a particular
I want to integrate the MySQL fulltext search function in my PHP site. I
I've been using the search function but I think there isn't any related question
I am trying to make a search function using the combination of DOM, PHP

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.