databases loaded of course. The get term is an autocomplete tring, which can be found in the database under groupname, but as you see, if it is not a match, i don’t want to run the first part of if, if found, yes. The problem is, if I replace the get term part for the actual string, it works, and if i add a string that is not present in the database, it still works like charm. But when get term is done, it doesnt matter if the string can be found or not, numrows will be larger than 0 anyway. Why? = and LIKE tried as well ofc
$query = "select * from `gamegroups` where `groupname` = '%{$_GET['term']}%'";
$resultset = mysql_query($query);
if (mysql_num_rows($resultset) > 0 ){
$lolz = array();
while( $row = mysql_fetch_assoc($resultset) ) {
$lolz[] = $row['gameid'];
}
echo json_encode($lolz);
}else{print "no match debug";}
?>
Because of the wildcard, I assume you want a like result?
What you really want is to make a relevance score, and return results ordered by relevance, but that is outside the scope of this question.