I have tried to connect a metadata tag to a user, I got the relationship between them but when I search the tag I get a large output. I have a tag named Chips, but the output is 17 different users. None of them have nothing todo with the word or the tag.
To clearify what I'm trying todo: I'm making a search function that can search for username, motto and tag. http://gyazo.com/d334447761152394ca1eecc392c35e92
<?php
$varr = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($url));
$varr = html_entity_decode($url,null,'UTF-8');
$query = $_GET['query'];
$min_length = 2;
if(strlen($query) >= $min_length){
$query = htmlspecialchars($query);
$query = mysql_real_escape_string($query);
$raw_results = mysql_query("SELECT * FROM users, user_tags
WHERE (`username` LIKE '%".$query."%') OR (`tag` LIKE '%".$query."%') OR (`motto` LIKE '%".$query."%')") or die(mysql_error());
$num_rows = mysql_num_rows($raw_results);
?>