Hi there!
I'm using PHP to create a simple, dynamic MySQL SELECT query.
The user chooses a selection from a HTML Form SELECT element's many options
and submits the form via a POST action.
The SELECT query is built as follows:
$itemtype = stripslashes(trim($_POST['selType']));
$query = "select * from item where item_subtype like '%$itemtype%'";
I've used:
echo "<center><b>".$query."</b></center><br />";
to see that the queries are being properly constructed.
When the option with the value of 'finding' is chosen, no records are
displayed, although there are many records in the item_subtype field of the
item table that contain the string 'finding', such as 'Earring finding' and
'chandelier finding'.
The display of records works fine when other values are chosen (other than
the value of 'finding')
Help!
Can anybody help me figure out what might be preventing records with
'finding' in the item_subtype field from showing.
I have no problem with any other of the SELECT element's values being passed
to the query.
Here is the 'offending' query: select * from item where item_subtype like
'%finding%'
Thank you so very much, in advance, for your help!
Peace!
(by the way, I'm not sure if the peculiarity is due to a problem in MySQL or
PHP, so I've posted in this newsgroup)