Hello Kirupians,
I created a search function that works perfect. There’s only one thing that doesn’t work as expected.
The search function searches into tables and stuff but when I search for a product for example EXAMPLE-1 and the value in the database is EXAMPLE1 i obviously don’t find a result.
How could I tell my script to ignore these values ,.-*
This is the script
<?php
mysql_connect("localhost","username","password");
mysql_select_db("database");
$search = $_POST["search"];
$search = mysql_real_escape_string($search);
$result = mysql_query("SELECT * FROM table WHERE (specificatie LIKE '%" . $search . "%' or omschrijving LIKE '%" . $search . "%' or type LIKE '%" . $search . "%' or vero LIKE '%" . $search . "%' or merk LIKE '%" . $search . "%' ) AND verberg = 'neen'");
if($search == ""){
print "enter something";
}else{
if(mysql_num_rows($result) > 0) {
while($r=mysql_fetch_array($result)) {
$vero = $r["vero"];
$id_web = $r["id_web"];
$merk = $r["merk"];
$groep = $r["groep"];
$subgroep = $r["subgroep"];
$type = $r["type"];
print "$merk $type";
}
} else {
print "nothing found";
}
}
?>