here is my php. the session ps comes from a another php page. it comes successfully. but i am getting undefined when i try to use it on the following code to connect to my db.
<?php
$pss = "";
session_start();
if(isset($_SESSION['ps'])){
$pss = $_SESSION['ps'];
}
echo $pss;
$connect = mysqli_connect("localhost","root","","erthiph_asksheikh851821217");
mysqli_query($connect,"INSERT INTO `as_questions`(`Qid`, `M_class`, `S_class`, `Question`, `Answer`, `Doctor`, `Time`) VALUES
('','','','".$pss."','','',CURRENT_TIMESTAMP)");
?>
the above code works. i replaced '$_POST[postquestion]' with '".@pss."' please check edit history to check edits.