I'm trying to echo out the information in the database profile in a session called $_SESSION['about']
, but whenever I echo it out nothing shows. I want it to show the information in the about_me table.
I inserted the information into my database and tried setting it to a session and using it on other pages to no avail.
if(isset($_POST['aboutme-submit'])){
require 'profiles.dbh.inc.php';
$about = mysqli_real_escape_string($conn2 ,$_POST['aboutme']);
$sql3 = "INSERT INTO profile(about_me ) VALUEs('$about')";
mysqli_query($conn2, $sql3);
$query = "SELECT * FROM profile WHERE about_me;";
$result = mysqli_query($conn2, $query);
$result_check = mysqli_num_rows($result);
if ($result_check > 0){
while ($row = mysqli_fetch_assoc($result)) {
}
}
session_start();
$_SESSION['about'] = $row['about_me'];
header("Location: ../profiles.php?nice.")
I expect the output of the information in the about_me row to be shown when I use $_SESSION['about']
, but the actual output is nothing at all.