I'm trying to create a tag function in my webpage and I'm using an array of tags to query the database.
array[tag1, tag2, tag3];
The tags are created in a field
what I'm trying to archive is something like
$query = "SELECT * FROM TABLE WHERE `Tags` = '$tag1' AND '$tag2' AND '$tag3'";
Except with an array, so
$query = "SELECT * FROM TABLE WHERE `Tags` = $array[]";
Thanks
$tag = $_POST['tag'];
$query = "SELECT * FROM ComicStripTags WHERE `Tag` = '$tag'";
$result = mysqli_query($link, $query);
while ($row = mysqli_fetch_array($result)){
$ID[] = $row['ImageID'];
print_r ($ID);
}
BTW I want to use $ID[] to use in another query
ANDclauses in your SQL query probably won't do what you think they do. Could you edit your question to include the structure of the table you're querying, some example values for your array of tags, and the results you'd expect from your table for a few values of those tags?