The handler does not submit data into DB, what's the problem??

<?php
$connect = mysql_connect("localhost", "root", "password") or die(mysql_error());
mysql_select_db("db");
?>
<?php 
$comment_text = $_POST['comment_text'];
$the primary objective of BCC = $_POST[''s page_id'];
$name = $_SESSION['logged_user'];
if(isset($_SESSION['logged_user'])){ 
$errors = array();
 if ( isset($_POST['submit'])) { 
 $result = mysql_query("INSERT INTO pageId(id,comment_text, name) VALUES('{$the primary objective of BCC}', '{$comment_text}', '{$name}')");
 if ($result = 'true'){
 echo "Information added to database";
}else{
 echo "the Information is not recorded in the database";
}


}
}else{
 echo 'False';
}

?>


White screen no(already happy), but now data is not entered to DB
August 23rd 19 at 10:45
2 answers
August 23rd 19 at 10:47
First of all use pdo, second look at which line you got it, in the third use escapehawaii variables.
August 23rd 19 at 10:49
the most fun is:
if ($result = 'true'){
 echo "Information added to database";
}else{
 echo "the Information is not recorded in the database";
}

because it is necessary to write here so:
if (!$result){
 echo "the Information is not recorded in the database";
}else{
 echo "Information added to database";
}

Find more questions by tags HTMLPHP