Hi,
Basically I am trying to qet a working query for Sample3 and Sample4 — they do not have the wildcard % character and use AND instead of OR.
Hope someone can help me out or point me in the right direction.
Sample1
// this works, except I dont want the wildcard % in there, I want it to match perfectly
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$query = "SELECT * FROM art_chk WHERE chk like '%$search_chknumber%' and code like '%$search_prdcode%' and detailed_description like '%$search_prdname%' and general_description like '%$search_description%' and art like '%$search_art%' ";
Sample2
// this works, except its OR and I need it to be AND as multiple things have to match
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$query = "SELECT * FROM art_chk WHERE chk like '$search_chknumber' OR code like '$search_prdcode' OR detailed_description like '$search_prdname' OR general_description like '$search_description' OR art like '$search_art' ";
Sample3
// this does not work, returns no results
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$query = "SELECT * FROM art_chk WHERE chk like '$search_chknumber' and code like '$search_prdcode' and detailed_description like '$search_prdname' and general_description like '$search_description' and art like '$search_art' ";
Sample4
//does not work, returns no results
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$query = "SELECT * FROM art_chk WHERE chk='$search_chknumber' and code='$search_prdcode' and detailed_description='$search_prdname' and general_description='$search_description' and art='$search_art' ";
Thanks