I'm hosting on NetworkSolutions (which has PHP 5.2.17) and every time I make a prepared statement it returns the error "Incorrect arguments to mysql_stmt_execute" D:
Can you help me spot the error in my code please? D:
<?php
$mysqli=new mysqli(host, username, password, db);
$query="INSERT INTO `Variables` VALUES (?, ?)";
$stmt=$mysqli->prepare($query);
$stmt->bind_param("ss", $cake, $lol);
$cake="lol";
$lol="pie";
$stmt->execute();
echo $mysqli->error;
$stmt->close();
$mysqli->close();
?>
However, when I run a prepared statement with only ONE parameter marker, it works :o
<?php
$mysqli=new mysqli(host, username, password, db);
$query="INSERT INTO `Variables` VALUES (?, 'lolcats')";
$stmt=$mysqli->prepare($query);
$stmt->bind_param("s", $cake);
$cake="lol";
$lol="pie";
$stmt->execute();
echo $mysqli->error;
$stmt->close();
$mysqli->close();
?>
Queries work too o: The only thing that doesn't work is using more than one parameter marker D: Can you help me find out why?
Thanks