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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.