Hi All,

I'm using PHP5/mysqli with object style bind_param,
which always reports "mysqli_stmt::bind_param() Number
of variables doesn't match number of parameters in
prepared statement" - even if they do match! - and
even using the sample code from the zend tutorial.

I have included the (slightly modified) zend code
below (I had to include a $mysqli->stmt_init() call
for it to work this far). All works well until the
$stmt->bind_param which causes the error.

I'm using PHP5/mysqli/MySQL4.1.3b-beta and WinXP

Does anybody have any thoughts/ideas?
Any help would be greatly appreciated.



$mysqli = new mysqli('localhost', 'xxx', 'xxx',

/* check connection */ 
if (mysqli_connect_errno()) { 
    printf("Connect failed: %s\n",
$stmt = $mysqli->stmt_init();
$stmt->prepare("INSERT INTO CountryLanguage VALUES (?,
?, ?, ?)"); 
$stmt->bind_param('sssd', $code, $language, $official,

$code = 'DEU'; 
$language = 'Bavarian'; 
$official = "F"; 
$percent = 11.2; 

/* execute prepared statement */ 

printf("%d Row inserted.\n", $stmt->affected_rows); 

/* close statement and connection */ 

/* Clean up table CountryLanguage */ 
$mysqli->query("DELETE FROM CountryLanguage WHERE
printf("%d Row deleted.\n", $mysqli->affected_rows); 

/* close connection */ 

___________________________________________________________ALL-NEW Yahoo! Messenger - 
all new features - even more fun!  http://uk.messenger.yahoo.com

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to