This is a discussion on Definition-list nesting problem within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello New poster to the group and a n00b to mySQL and PHP of a couple of weeks. Built an ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello
New poster to the group and a n00b to mySQL and PHP of a couple of weeks. Built an Ubuntu server 2 weeks ago to fit in with my conversion of all the pcs in the house to Linux. Have got MySQL and PHP running fine and got stuck in converting my old Access dbs. So far am pleased with the results in the time I swore I wouldn't keep asking n00b questions in NGs and forums and would figure things out, but this one is driving me insane. Got my search page to produce a numbered list of clickable links, those links then open a page with more details from that record - that works fine. I am now trying to get the format of the details page right (the easy bit I thought!) I know I am missing something really basic and stupid and it is just a problem with my nesting somewhere but I would really appreciate a pointer please. I am trying to produce a definition-list using the field name as the definition-list term and the field content as the the definition-list definition. I can get a list of terms, or a list of definitions after a lot of trial and error, I am now at the stage where I have both... but I have the terms as one list and the definitions as another list below. Here's the code: ////////////////////////////////////////// // Printing results in definition list echo "<dl>"; while ($headers = mysql_fetch_field($result)){ Â* Â* Â* Â* echo "<dt><h4>" . $headers->name . "</h4></dt>"; } Â* Â* Â* Â* while ($entry = mysql_fetch_array($result, MYSQL_ASSOC)){ Â* Â* Â* Â* Â* Â* Â* Â* foreach ($entry as $col_value){ Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* echo "<dd>$col_value</dd>"; Â* Â* Â* Â* } } echo "</dl>"; ///////////////////////////////////////// Any help/pointers gratefully received. Cheers David -- Knowledge is of two kinds: we know a subject ourselves, or we know where we can find information upon it. (Samuel Johnson) Only the mediocre are always at their best. (Jean Giraudoux) (Reply address genuine - Checked occasionally) |
|
|||
|
On Saturday 19 Apr 2008 18:06 Baldylocks-Ubuntu licked a pencil and jotted:
snip > > Any help/pointers gratefully received. > > Cheers > > David N/m sorted it, thanks if anyone thought about it. David -- Knowledge is of two kinds: we know a subject ourselves, or we know where we can find information upon it. (Samuel Johnson) Only the mediocre are always at their best. (Jean Giraudoux) (Reply address genuine - Checked occasionally) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|