Skip to main content
Flash Curious
Participant
Nov 16, 2006 1:37 PM UTC
Question

PHP Search Wildcard Problem

I'm searching using 1 text box and two dynamically loaded lists. The lists work fine and the text box finds the correct field IF the whole string is inserted. It will not do partial string returns. Also, how can I default the text box to % without having the symbol appear? Using DW 8.02.
This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Flash Curious
Participant
Nov 16, 2006 5:49 PM UTC
I found the fix. It involved stripping out most of the extra formatting code inserted by DW:

$var1_Recordset2 = $_GET['sname'];
$var2_Recordset2 = $_GET['class'];
$var3_Recordset2 = $_GET['stimezone'];

mysql_select_db($database_mt_connect, $mt_connect);
$query_Recordset2 = "SELECT * FROM mt_students WHERE sname like '%%%$var1_Recordset2%%' and class like '$var2_Recordset2' and stimezone like '$var3_Recordset2'";
Translate