As question said, I want to use the LIKE Operator so whenever user inputs something, like "M", it returns all database entries starting with "m" rather then anything named just "M". This is my code
$strSymbolName = @$_REQUEST["searchSymbol"];
//searchSymbol is the variable with user Input inside
if(!empty($strSymbolName))
{ // process the form
// Establish dbserver connection and default database
$db = $objDBUtil->Open();
// Run a Query to get company name
$query = "SELECT symSymbol, symName FROM symbols " .
"WHERE symSymbol =" . $objDBUtil->DBQuotes($strSymbolName);
//Retrieves company symbol and name from database. Stores this in result
$result = $db->query($query);`
What I thought of doing was using the LIKE operator on the WHERE statement, so something like-
WHERE symSymbol LIKE = " . $objDBUtil->DBQuotes($strSymbolName);
But this didn't work...How would I apply the LIKE operator here?
"LIKE %".$objDBUtil->DBQuotes($strSymbolName)."%"=sign afterLIKEand then use%wildcard markers where appropriate.