开发者

MySQLi PHP error

开发者 https://www.devze.com 2023-03-06 04:07 出处:网络
I have following function <?php error_reporting(E_ALL); ini_set(\"display_errors\", true); @ $dbh= new mysqli(\'localhost\', \'root\', \'hsenidsoft\', \'1005\');

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

0

精彩评论

暂无评论...
验证码 换一张
取 消