Fatal error: Call to a member function bind_param() on a non-object in C:\AppServ\www\param.php on line 10
Código PHP:
<?php
$mysqli = new mysqli($GLOBALS['localhost'], $GLOBALS['prueba'], $GLOBALS['root'], $GLOBALS['root']);
if (mysqli_connect_errno()) {
echo "Connection Failed: " . mysqli_connect_error();
exit();
}
$producto = "Ariel";
$precio = 11.25;
$stmt = $mysqli->prepare("INSERT INTO prueba_tabla (producto,precio) VALUES (?,?)");
$stmt->bind_param('sd', $producto, $precio);
$result = $stmt->execute();
if ($result) {
// do something
} else {
echo $mysqli->error;
}
$stmt->close();
$mysqli->close();
?>