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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:10:43+00:00 2026-06-10T20:10:43+00:00

I’ve been trying to get a php/mysqli simple search up and running, but i

  • 0

I’ve been trying to get a php/mysqli simple search up and running, but i can’t seem to get it working. I’ve been following some directions i found in an earlier question (Link) but it still won’t work.

$sql = 'SELECT product_title FROM product ';
$where = array();
$values = array();
$types = '';

if (isset($_GET['searchText']) and $_GET['searchText'] != '') {
    $where[] = 'WHERE product_title = ?';
    $values['titel'] = $_GET['searchText'];
    $types .= 's';
}

if (isset($_GET['searchCategorySelect']) and $_GET['searchCategorySelect'] != '') {
    $where[] = 'WHERE product_categoryid = ?';
    $values['category'] = $_GET['searchCategorySelect'];
    $types .= 's';
}

$sql .= implode(' AND ',$where);
$values = array_unshift($values, $types);

$search_stmt = $mysqli->prepare($sql);
$search_stmt->bind_param($values);
$search_stmt->execute();

That results in this error message:
“Wrong parameter count for mysqli_stmt::bind_param() in…”

Some advice or help would be appreciated.

  • 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-06-10T20:10:45+00:00Added an answer on June 10, 2026 at 8:10 pm

    mysqli_stmt::bind_param expects minimum of 2 parameters, but you are passing one

    Syntax:

    bool PDOStatement::bindParam ( mixed $parameter , mixed &$variable [, int $data_type = PDO::PARAM_STR [, int $length [, mixed $driver_options ]]] )
    

    Where

    Parameter: Parameter identifier. For a prepared statement using named
    placeholders, this will be a parameter name of the form :name. For a
    prepared statement using question mark placeholders, this will be the
    1-indexed position of the parameter.

    Variable: Name of the PHP variable to bind to the SQL statement
    parameter.

    data_type: Explicit data type for the parameter using the PDO::PARAM_*
    constants. To return an INOUT parameter from a stored procedure, use
    the bitwise OR operator to set the PDO::PARAM_INPUT_OUTPUT bits for
    the data_type parameter.

    length: Length of the data type. To indicate that a parameter is an
    OUT parameter from a stored procedure, you must explicitly set the
    length.

    You could also do it like this:

    $values = array_unshift($values, $types);
    call_user_func_array (array ($search_stmt, 'bind_param'), $values);         
    $search_stmte->execute();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.