I have this SQL query:
$query = $mysqli->prepare("SELECT * FROM ft WHERE Aar = ? AND AmtHerredSognGade LIKE '%".$sogn."%'");
I need to be able to put in a constant in the search string before the result of $sogn.
E.g if the $sogn returns "Gudhjem" I need to put in a string before Gudhjem, in this case Bornholm, so that the total searchstring becomes "Bornholm Gudhjem".
The string I need to put in before the $sogn are represented in the table in a column with the headline "Amt" and I would naturally like to pull it from there.
I know that the string for searching for $sogn are broad with jokers but it have to be that because the "AmtHerredSognGade" field in the table is a combined field from where I need to pull out the part matching the query.
I hope that somebody have the golden idea to fix this :)