2015-06-19, 04:21 PM
$query2 = $db->query("
SELECT c.url, c.id
FROM ".TABLE_PREFIX."content c
WHERE c.url LIKE '%".$db->escape_string_like($mybb->input['id'])."%'
limit 1
");
$test = $db->fetch_array($query2);
echo $test['id'];
I am trying to match this in SQL this-is-a-test then return ID of the column that matches it 100%. The problem is when it doesn't match any it juts returns 1
That mean it always shows thread content with the ID 1 for errors!
How to show an error or some when the search is negative?