I am trying to insert an array value into a sql SELECT statement.
When I try to assign the selected value or an array (from a form
SELECT option/value array) I put in this code:
foreach ($_GET['sort'] as $val){
$sql = "SELECT * FROM `new_mowers` WHERE '$val' = '% $userquery%' LIMIT 0, 30";
}
I am using Homesite 5.0 to develop and it does not highlight foreach as it does for any other PHP construct.
I thought the problem may be a glitch in Homesite but when I ran the code anyway the page returned blank. If I take this code out and hardcode the query everything is fine?
Why is Homesite and PHP not recognizing foreach?