How to display multiple cell entries individually from a MySQL database and using PHP

Posted by Jake on Stack Overflow See other posts from Stack Overflow or by Jake
Published on 2010-03-22T02:07:19Z Indexed on 2010/03/22 2:11 UTC
Read the original article Hit count: 404

Filed under:
|

I have a column called post_tags where there is sometimes one tag entry and sometimes multiple tags stored. These are separated by * symbols. I want to display these out to the screen one by one. If there were just one item inside the cell I would have used:

$query = mysql_query("SELECT post_tags FROM posts WHERE id=$id");

while ($result = mysql_fetch_assoc($query)) {
         $result['post_tags'];
}

But how can I display each entry individually when there are multiple ones in one cell (is this what the explode function is for)?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql