Note that there are some explanatory texts on larger screens.

plurals
  1. POmysqli bind_param giving error: (1210) Incorrect arguments to mysql_stmt_execute
    primarykey
    data
    text
    <p>I have this exact same code working great on another server:</p> <pre><code>$mysqli_Cxn = new mysqli($SQL_HOST,$SQL_USER,$SQL_PASS,$SQL_DB); if($mysqli_Cxn-&gt;connect_errno){ echo 'Unable to connect!!'; exit(); } $userID=12345; $userFirstName = 'Charley'; $userLocale = 'en_US'; $sql = "UPDATE userProfile SET userFirstName=?, userLocale=? WHERE id=?"; if($stmt = $mysqli_Cxn-&gt;prepare($sql)){ if(!$stmt-&gt;bind_param('ssi',$userFirstName,$userLocale,$userID)){ echo "&lt;br/&gt;&lt;br/&gt;Binding parameters failed: (" . $stmt-&gt;errno . ") " . $stmt-&gt;error; } if($stmt-&gt;execute()){ totalAffected=$stmt-&gt;affected_rows; if($totalAffected&gt;=1){ echo '&lt;br/&gt;&lt;br/&gt;UPDATE OK: Affected rows = '. $totalAffected; } }else{ echo "Execute failed: (" . $stmt-&gt;errno . ") " . $stmt-&gt;error; } } $stmt-&gt;close(); </code></pre> <p>That code gives me the following output: Execute failed: (1210) Incorrect arguments to mysql_stmt_execute</p> <p>If I change these two lines:</p> <pre><code>$sql = "UPDATE userProfile SET userFirstName=?, userLocale=? WHERE id=?"; $stmt-&gt;bind_param('ssi',$userFirstName,$userLocale,$userID); </code></pre> <p>to this:</p> <pre><code>$sql = "UPDATE userProfile SET userFirstName=?, userLocale='en_US' WHERE id=12345"; $stmt-&gt;bind_param('s',$userFirstName); </code></pre> <p>...then the Update is successful and I don't get any error.</p> <p><strong>Does anyone know why I can't bind more than one param in this code?</strong></p> <p>I had this code running perfectly on a Centos 4.9, PHP 5.3.3, MySQL 5.0.91/5.0.91-community-log</p> <p>I need to run it on my current server which is Centos 6.2, PHP 5.3.10, MySQL 5.0.95-community-log</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload