May I know how to pass the values from $query if there is values in it. And if it empty, I would still have to pass the variables. I keep getting errors of undefined variable though the variables do exist in the sql database.
<?php
include("dbconnect.php");
include("header.php");
if (isset($_POST['btn'])) {
$uname = $MySQLi_CON->real_escape_string(trim($_POST['user_name']));
$email = $MySQLi_CON->real_escape_string(trim($_POST['user_email']));
$upass = $MySQLi_CON->real_escape_string(trim($_POST['password']));
$enroller_id_n = $MySQLi_CON->real_escape_string(trim($_POST['enroller_id_n']));
$enrolled_id_n= $MySQLi_CON->real_escape_string(trim($_POST['enrolled_id_n']));
$direction = $MySQLi_CON->real_escape_string(trim($_POST['direction'])) ;
$new_password = password_hash($upass, PASSWORD_DEFAULT);
$query = $MySQLi_CON->query("select * from personal where enroller_id='".$enroller_id_n."'");
if($query){
while ($row = $query->fetch_array()) {
$enroller_id3 = $row['enroller_id'];
$left_mem = $row['left_mem'];
$right_mem = $row['right_mem'];
$test = "left_mem";
$test2 = "right_mem";
$direc = $direction;
}
}
}
?>