Array declared:
$names = array("country_code", "postal_code", "place_name", "admin_name1", "admin_code1", "admin_name2", "admin_code2", "admin_name3", "admin_code3");
for ($i = 0; $i < 9; $i++)
{
$current = $names[$i];
$results = query("SELECT * from places WHERE country_code LIKE ?", $piece);
$results = query("SELECT * from places WHERE ? LIKE ?", $current, $piece);
...
}
But the first query would select data from the table whereas the second query wouldn't. Is there any reason why is that, and is it possible to fix it? By the way $piece is just the a part of the $_GET (such as US from Cambridge,+MA+US).