in Education by
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"); ?> <?= $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", "מחק עסק")." ".anchor ("admin/edit/$company->id", "ערוך עסק")." ".anchor ("admin/editcamp/$campaign_id->id", "ערוך קמפיין"); ?> <? } ?> JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Try changing $search_text = $this->input->post('name'); with $search_text = $this->input->post('company'); in function search()

Related questions

0 votes
    In my textbook I noticed that both these algorithms work almost exactly the same, I am trying to understand ... would be appreciated. Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    Elastic Search Questions and Answers...
asked Jul 11, 2022 in Technology by sandeepthukran
0 votes
    Which of these method returns a largest whole number less than or equal to variable X? (a) double ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    I already can update my data from database but the problem is i just want to update one data, but when I enter the ... all of data in the database table like this this is View:...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    Previously I used org.webrtc:google-webrtc:1.0.26885 and it was fine, now I switched to the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    please check following code public boolean isOnline() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context. ... addr = ((addrBytes[3] & 0xff)...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    I'd like to ensure my RAII class is always allocated on the stack. How do I prevent a class from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I'd like to ensure my RAII class is always allocated on the stack. How do I prevent a class from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Which of the following takes a dict of dicts or a dict of array-like sequences and returns a DataFrame ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
0 votes
    I have an HTML table with a search field to filter the result by Name. And another field to show ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    Which of the following scenarios leads to linear running time for a random search hit in a linear-probing ... topic in division Indexing and Hashing of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    $fields['password'] = "Password"; $fields['confirm_password'] = "Confirm Password"; $fields['customer_number' ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Aug 1, 2022 in Education by JackTerrance
0 votes
    How to get array from form validation config file in controller? application/config/form_validation.php I have ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
...