1
I have to take my user id and save in a variable the name related to this id, but it is not working !
function inReg() {
global $connect;
$id_usuario = $_POST["id_usuario"];
$denuncia = $_POST["denuncia"];
$nome = "SELECT nome FROM usuario WHERE id_usuario = '$id_usuario'";
$query = " Insert into denuncia (id_usuario, denuncia) values
('$id_usuario','$denuncia')";
mysqli_query($connect, $query) or die (mysqli_error($connect));
mysqli_close($connect);
require 'rotinas_emails/registro_denuncia_mail.php';
}
?>
In this variable $name is saving the sql itself " New Report sent by SELECT name FROM user WHERE id_usuario = '74'"
You need to execute select in your code vc only created a string with an sql command.
– rray
the id_usuario of the two tables are equal? for which the select name of the user table?
– user60252
Actually and only one table, this select I do to send the variable name to another page that will be sent an email with the data.
– Juliano Morche