Hi, I'm wondering what type of mysqlfield would be advantageous for outputting the containing text as a bullit list in php and if the text should be formatted a certain way.

I would be supergrateful for an example! :p

Take care
Adam

Recommended Answers

All 3 Replies

Either char or varchar will do, but there are differences between these two data types. It depends on exactly how you want to store this information in the database.

Have your written any of the PHP code yet, and are stuck on something specific?

right now I have a text field filled with text seperated by semicolons to represent where the "bullets" should be. I'm open to change the format of the text in any way to simplify the output of the bullitlist.

I Havn't started coding the php output as I don't want to start in the wrong end and having to do it all over if some basic stuff as if fieldtype is wrong or if it's better to format the ingoing text in some specific way.

Cheers

Ok, if someone finds this thread, this is how i echo a textfield in mysql as a bulletlist. The text have semicolons where the breaks and bullets should be:

 <?php 
                    $Keyfindings2 = explode(';', $Keyfindings);
                    echo "<ul style=\" list-style-type:upper-roman;\">\n";
                        foreach( $Keyfindings2 as $item )
                            {
                            echo "<li>$item</li><br />\n";
                            }
                            echo "</ul>";?>

Boooom, when you know the answer it seems so obvious :)

Have a good one!
/Adam

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.