kapag maiksi sinulat ko ok sya may output pero kapag mahaba na text ito error nya
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'comment'])){ $comment_content = $_POST['comment_content']; $post_id=$_POST[...' at line 1 in C:\xampp\htdocs\Innerjoin\user\comment.php:39 Stack trace: #0 C:\xampp\htdocs\Innerjoin\user\comment.php(39): mysqli_query(Object(mysqli), 'INSERT INTO pos...') #1 {main} thrown in C:\xampp\htdocs\Innerjoin\user\comment.php on line 39
ito code ko
if (isset($_POST['post'])){
$page_content = $_POST ['post_content'];
$pagecontent = $_POST ['postcontent'];
mysqli_query($con,"INSERT INTO post (comment,title,date_created,user_id) values ('$page_content','$pagecontent','".strtotime(date("Y-m-d h:i:sa"))."','$user_id') ")or die(mysqli_error());
}
?>
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'comment'])){ $comment_content = $_POST['comment_content']; $post_id=$_POST[...' at line 1 in C:\xampp\htdocs\Innerjoin\user\comment.php:39 Stack trace: #0 C:\xampp\htdocs\Innerjoin\user\comment.php(39): mysqli_query(Object(mysqli), 'INSERT INTO pos...') #1 {main} thrown in C:\xampp\htdocs\Innerjoin\user\comment.php on line 39
ito code ko
if (isset($_POST['post'])){
$page_content = $_POST ['post_content'];
$pagecontent = $_POST ['postcontent'];
mysqli_query($con,"INSERT INTO post (comment,title,date_created,user_id) values ('$page_content','$pagecontent','".strtotime(date("Y-m-d h:i:sa"))."','$user_id') ")or die(mysqli_error());
}
?>