I am trying to insert a record into my table and then to use array push to create an array with that record but it seems that I am missing something here.. I use
$insert_sql = "INSERT INTO PasswordResetRequest(email,encrypted_temp_password,salt,created_at) VALUES('$email','$encrypted_temp_password','$salt',NOW());";
$insert_query = mysqli_query($con,$insert_sql);
$ins_result = array();
while($row = mysqli_fetch_array($insert_query)) {
array_push($ins_result, array(
'email' => $row['email'],
'encrypted_temp_password' => $row['encrypted_temp_password'],
'salt' => $row['salt'],
'created_at' => $row['created_at']
));
}
if ($ins_result) {
$user["email"] = $email;
$user["temp_password"] = $random_string;
return $user;
} else {
return false;
}
but I get an array with null, how should I implement it?
Thank you