Question
PHP/MySQL Search SQL
I am trying to build a search page on my site. I am wanting
it to search by "name". I have it wokring is someone types in the
whole name exactly.
mysql_select_db($database_siteText, $siteText);
$query_Recordset1 = sprintf("SELECT * FROM reviews WHERE review_name = %s", GetSQLValueString($colname_Recordset1, "text"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $siteText) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
When I click test in DW and it give me the box to type in, if I put the whole name it works fine. However I would like it find part of the name too. Is there a wildcard I should use.
Ex. Complete name in database "John Doe"
If I type exactly that it works fine but I would like it where a user can just type "john" and get a list of ever name that includes john.
Thanks
mysql_select_db($database_siteText, $siteText);
$query_Recordset1 = sprintf("SELECT * FROM reviews WHERE review_name = %s", GetSQLValueString($colname_Recordset1, "text"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $siteText) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
When I click test in DW and it give me the box to type in, if I put the whole name it works fine. However I would like it find part of the name too. Is there a wildcard I should use.
Ex. Complete name in database "John Doe"
If I type exactly that it works fine but I would like it where a user can just type "john" and get a list of ever name that includes john.
Thanks
