I'm trying to create a php file that searches on a DB that I created with mysql in ubuntu, but when I run the query I get this error but I can not understand why !!! When I print the error, the data I've passed is correct and is displayed in the string !!!!!
I think it's a syntax error but I can not figure out where it is !!!!
This is the excerpt where I create my string and I do my Query:
$sql_find = ("SELECT CITY, ADRESS, CAP FROM PEOPLE WHERE ID_PERSON = $idperson AND NAME_PERSON = $name AND SURNAME = $surname ") ;
print $sql_find;
$result= mysqli_query($connect,$sql_find) or die ("Error: ". mysqli_error($connect)." with query ");
The data that is passed are Name, Surname and the id of the person I create in an app. Example:
$idperson=RM120463 $name = Mario $surname = Rossi
When I print the error it also prints the select I created which is:
SELECT CITY, ADRESS, CAP FROM PEOPLE WHERE ID_PERSON = RM120463 AND NAME_PERSON = Mario AND SURNAME = Rossi
Why gives me the error if the query is composed right?
Thanks only you can help me !!!!!