Answer the question
In order to leave comments, you need to log in
How to get a value from a database without passing parameters to a method?
There is an input (disabled) field in which I pass the user's first and last name from the database. Question: how can I pass the user's first and last name without passing parameters to the method, I threw in such a construction, but in this method I pass two parameters (I check soap and password), but how to rewrite the construction so as not to pass parameters, since the field should be filled in automatically when entering the page.
public function check_firstname_lastname($user_email, $user_pass) {
if ($this->connect_db()->connect_errno) {
die(mysqli_error($this->connect_db()));
} else {
$user_password = md5(md5($user_pass) . md5($user_email));
$user_firstname_lastname = "SELECT `user_firstname`, `user_lastname` FROM `user` WHERE `user_email` = '$user_email' AND `user_password` = '$user_password'";
return $user_firstname_lastname;
}
}
public function check_firstname_lastname() {
if ($this->connect_db()->connect_errno) {
die(mysqli_error($this->connect_db()));
} else {
$user_firstname_lastname = "SELECT `user_firstname`, `user_lastname` FROM `user` WHERE `user_email` = '$_SESSION[user_email]'";
return $user_firstname_lastname;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question