I need to pass values from a form that includes this drop-down selection:
<select name="[COLOR=Sienna]$searchby[/COLOR]">
<option value="null"> Select one
<option value="[COLOR=DarkRed]a.name[/COLOR]"> Name
<option value="[COLOR=DarkRed]a.addr[/COLOR]" > Address
<option value="[COLOR=DarkRed]a.zip[/COLOR]" > Zip code
</select>
to a php/mysql querry where it will serve as the column identifier in a WHERE statement:
SELECT a.name, a.addr, a.zip from table
WHERE [COLOR=Sienna]$searchby[/COLOR] like '$search%'
I have the "$search%" variable passing fine, thanks to folks on this board. When I try to make the column variable, though, I'm getting "Check for... right syntax to use near 'like '%' "
I've read manuals, searched Web and tried several other approaches to get the column variable passed but to no avail. It seems I need to set up an array, but I get an sql error that tells me something like there is "no column named array".
I'm sure this is elementary. Any ideas?