Php mysqli and stored-procedure
- by Mneva skoko
I have a stored procedure:
Create procedure news(in dt datetime,in title varchar(10),in desc varchar(200))
Begin
Insert into news values (dt,title,desc);
End
Now my php:
$db = new mysqli("","","","");
$dt = $_POST['date'];
$ttl = $_POST['title'];
$desc = $_POST['descrip'];
$sql = $db-query("CALL news('$dt','$ttl','$desc')");
if($sql)
{
echo "data sent";
}else{
echo "data not sent";
}
I'm new with php please help thank you