Hello, so i made table with Tags row which is Text(126).. and idea is to put text like "PHP, MySQL, Forum, Blog" etc etc...
I have problem searching tags my search code:
$requestedtag = $con->real_escape_string($_GET['tag']);
$sql = "SELECT * FROM images WHERE tags = '$requestedtag' ORDER BY ID DESC LIMIT 12";
$result = $con->query($sql);
if ($result->num_rows > 0)
{
while($row = $result->fetch_assoc()) {
$image_id = $row["ID"];
$image_title = $row["Title"];
$image_url = $row["ImgURL"];
$image_tags = $row["Tags"];
echo '<div class="col-3"><div class="thumb"><a href="/image.php?id='.$image_id.'" title="'.$image_title.'"><img src="'.$image_url.'"></img></a></div></div>';
}
}
But it doesnt return anything. I think the problem is that row["Tags"]; is divided by "," from tags and i should split it somehow but i dont really know what to do...