Hi,
I'm expanding a search feature on my site to include a variety of different field combinations.
My current simple db selection looks like this
$result = mysql_query("SELECT * FROM clubs WHERE checked = 'Y' AND $a LIKE '%$b%' ORDER BY $a LIMIT $offset,10",$db)
and this works fine.
What I'm trying to do now is build the select string depending on the values selected, such as this
if ($i == "1") {
$sqlsearch1="mysql_query(\"SELECT * FROM clubs WHERE checked = 'Y' AND $a LIKE '%$b%' ORDER BY $a LIMIT $offset,10\",$db)"; }
I then use this string like this
$sql = "$sqlsearch1";
and I get a syntax error.
The value in $sqlsearch1 works perfectly well if it not held in a variable. I know I'm missing something but I just don't know what.
Any help would be appreciated.
Thanks