This is my query:
$query = "INSERT INTO studente (Nome, Cognome, Matricola, Username, Codice)
SELECT 'Nome', 'Cognome', 'Matricola', 'Username' FROM studenti_in_sessione
WHERE studenti_in_sessione.Username = '".$_REQUEST['username']. "';" ;
$result = $db_handle->insertQuery($query);
This is insertQuery method:
function insertQuery($query) {
$result = mysqli_query($this->conn,$query);
if (!$result) {
die('Invalid query: ' . mysql_error());
} else {
return $result;
}
}
The method returns Invalid query: without error messages.
Possible that I wrote the query with "" or "" or actually is wrong, but I do not know where ...