Jump to content

[SOLVED] tagcloud help


engelsol

Recommended Posts

$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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.