engelsol Posted June 26, 2007 Share Posted June 26, 2007 $tags = "engel,Martin Torrijos,engel,engel,pizza,pizza,house,pizza,Martin Torrijos,house,order,now,order,Martin Torrijos,pizza,margarita,salami,salami,Martin Torrijos,pizza,hot,hot,steamy,hot,taste,quick,love,sexy,love,yummie,pizza,pizza,margarita,salami,expensive"; I have this tags list in the about format to populate a tagcloud. Now I want to generate that tag list dinamically from a tag table. tag table field: tagid tagname $q = "SELECT tagname FROM tagcodes "; $tags_index_query = mysql_query($q); while ($row = mysql_fetch_array($tags_index_query )) { what goes here ? } Engel Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 Now I want to generate that tag list dinamically from a tag table. I don't understand what your trying to do. What do you mean by dynamically generating a tag list FROM a tag table. Please give details on how you want it populated from using your table. Quote Link to comment Share on other sites More sharing options...
engelsol Posted June 26, 2007 Author Share Posted June 26, 2007 for example in the tags table this are the current tags engel,Martin Torrijos,engel,engel,pizza,pizza,house,pizza,Martin Torrijos,house,order,now,order,Martin Torrijos,pizza,margarita,salami,salami,Martin Torrijos,pizza,hot,hot,steamy,hot,taste,quick,love,sexy,love,yummie,pizza,pizza,margarita,salami,expensive here they are separated by comma. but in the db table each one is a record... for my php tagcloud script I can populate the tag cloud manually putting all tag I want separated by a comma... now I just need to do this automatically. I need to construct some query so that I can get something like: $tags = "all tags separated by a comma"; I dont know how to build that part. Engel Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 Why don't you just store all the tags in an array, would that work? They would all be separated, and easy to access. <?php $query = mysql_query("SELECT tagname FROM tagcodes"); while ($row = mysql_fetch_assoc($query)){ $tags[] = $row['tagname']; } echo '<pre>'; print_r($tags); echo '</pre>'; ?> Quote Link to comment Share on other sites More sharing options...
engelsol Posted June 26, 2007 Author Share Posted June 26, 2007 please show me howto store in an array I think that is the best solution. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 The code above will do that =] Quote Link to comment Share on other sites More sharing options...
engelsol Posted June 26, 2007 Author Share Posted June 26, 2007 thanks Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 No problem. Don't forget to mark the thread as solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.