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 Link to comment https://forums.phpfreaks.com/topic/57200-solved-tagcloud-help/ 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. Link to comment https://forums.phpfreaks.com/topic/57200-solved-tagcloud-help/#findComment-282689 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 Link to comment https://forums.phpfreaks.com/topic/57200-solved-tagcloud-help/#findComment-282691 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>'; ?> Link to comment https://forums.phpfreaks.com/topic/57200-solved-tagcloud-help/#findComment-282693 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. Link to comment https://forums.phpfreaks.com/topic/57200-solved-tagcloud-help/#findComment-282697 Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 The code above will do that =] Link to comment https://forums.phpfreaks.com/topic/57200-solved-tagcloud-help/#findComment-282698 Share on other sites More sharing options...
engelsol Posted June 26, 2007 Author Share Posted June 26, 2007 thanks Link to comment https://forums.phpfreaks.com/topic/57200-solved-tagcloud-help/#findComment-282701 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 Link to comment https://forums.phpfreaks.com/topic/57200-solved-tagcloud-help/#findComment-282702 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.