cottonbuds2005 Posted October 16, 2009 Share Posted October 16, 2009 Please bear with me because Im a newbie at SQL / PHP stuff. My database is an inventory of all our PC equipment. What I want to do is make a search for a serial number with wildcard strings at the end. example: when I enter the serial number LVW9 I want the results for all PCs having sn starting with that string. Like LVW9237, LVW9228 etc etc The code below allows just the exact sn for the PC. How to do this? Please help me. ___________________________________________ mysql_select_db($database_ITInventory, $ITInventory); $query_SearchSerial = sprintf("SELECT * FROM assetsdb WHERE SerialNo = %s", GetSQLValueString($colname_SearchSerial, "text")); $SearchSerial = mysql_query($query_SearchSerial, $ITInventory) or die(mysql_error()); $row_SearchSerial = mysql_fetch_assoc($SearchSerial); $totalRows_SearchSerial = mysql_num_rows($SearchSerial); Quote Link to comment https://forums.phpfreaks.com/topic/177881-moved-simple-search-query-in-php-mysql-please-help/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.