Hello,
I am new to the forum and PHP. I am having a little trouble with the syntax of my Select statement. Here is what I have:
$var = $_POST[“lname”];
$trimmed = trim($var);
$query = “Select
Account_Info.Account_Num,
Account_Info.Owner_Name1,
Account_Info.Owner_Address_Line2,
account_apprl_year.TOT_Val
From Account_Info
INNER JOIN account_apprl_year
ON Account_Info.Account_Num=account_apprl_year.Account_Num
Where Owner_Name1 like “%$trimmed%””
I’m simply trying to search a MySQL database by last name and retrieve the records. I’m catching the last name in the POST and trimming it. Now I would like to use the trimmed variable in my Select statement but it is not working. I can’t see where the problem is. Does my Select statement look like it is formatted properly?
Thanks,
Darin