0

Right im very new to php and kinda learning as i go, here is my code.

What it is, is when i search a part number it has to be matching the case e.g if i search a6725 it doesnt work but if i search A6725 its returns the result.

please help!!!

$qresult = mysql_query("SELECT * FROM products WHERE part = \"$pt\"");
    $row = mysql_fetch_array($qresult);
		{
		do 
		{
			echo "<tr><td>".$row['part']."</td></tr>";
			echo "<tr><td>".$row['desc']."</td></tr>";
			echo "<tr><td>"; 
				if ($row['part'] <> $pt){
					echo $none;
					}
				elseif ($row['qt'] == $qty){
   					echo $limit;
					}		
				elseif ($row['qt'] >= $qty){
   					echo $in;
					}
				elseif ($row['qt'] <= $qty){
   					echo $out;
					}
		}
		while($row = mysql_fetch_array($qresult));
		}	
		
	echo "</table>";
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by dandixon
0
$query="SELECT * FROM products WHERE part  LIKE \"%$pt%\""

This will match any string in the column `part` where the substring/string contained in $pt is found

0

solved it thanks anyway used this in the form code

onBlur="this.value=this.value.toUpperCase()"

to force it to search in uppercase

ta

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.