Jump to content

Simple SQL search question... pls help


cottonbuds2005

Recommended Posts

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);

 

Link to comment
https://forums.phpfreaks.com/topic/177857-simple-sql-search-question-pls-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.