MySQLi PHP error
I have following function
<?php
error_reporting(E_ALL); ini_set("display_errors", true);
@ $dbh= new mysqli('localhost', 'root', 'hsenidsoft', '1005');
$stmt = $dbh->prepare("CALL populateDefaultTrainStructureTest(?,?)");
$startdate = '2011-05-16';
$counter =1 ;
$stmt->bindValue(1, $startdate, PDO::PARAM_DATE);
$stmt->bindValue(2, $counter, PDO::PARAM_INT);
$stmt->execute();
?>
when i execute the function i got
Fatal error: Call to undefined method mysqli_stmt::bindValue() in /var/www/sp.php on line 8 error
var_dump($stmt)
object(mysqli_stmt)
#2 (9) { ["affected_rows"]=> int(0) ["insert_id"]=> int(0) ["num_rows"]=> int(0) ["param_count"]=> int(2) ["field_count"]=> int(0) ["errno"]=> int(0) ["error"]=> string(0) "" ["sqlstate"]=> string(5) "00000"开发者_Python百科 ["id"]=> int(1) } Fatal error: Call to undefined method mysqli_stmt::bindValue() in /var/www/sp.php on line 11
There is no bindValue
function but there is mysqli_stmt::bind_param
精彩评论