Latest Lists

Can anyone here help me create a PHP script that would display a block of text in LIST form?

I have a mysql table which contains a record of composed of paragraphs and lists. Can anyone help me with a script that would detect and convert short text and display them with list (UL or LI) tags.

Public Comments

  1. // Open unordered list. Replace with <ol> for ordered. echo "<ul>"; // Make your query, make it an associative array. $query = mysql_query(...insert your query here...); // start count $c=0; // While loop for results while($lines = mysql_fetch_array($query, MYSQL_ASSOC) { // place your field name into a var - make new ones as required. $this_Value = mysql_result($query,$c,'database field name'); // print the list elements. echo "<li>$this_Value</li>"; // add to count and move through array. $c++; } // close (un)ordered list. echo "</ul>";
Powered by Yahoo! Answers