Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$mysqli->query("create table t (i int)");
$stmtAddNoticia = mysqli_stmt_init($mysqli);
$queryAddNoticia = "INSERT INTO t (i) VALUES (?)";
if (mysqli_stmt_prepare($stmtAddNoticia, $queryAddNoticia)) {
mysqli_stmt_bind_param($stmtAddNoticia, 's', $tituloPT=1);
if (mysqli_stmt_execute($stmtAddNoticia)) {
echo "ok";
} else {
echo "error 1";
}
} else {
echo "<br><br> error 2";
}