|
Posted by Jerry Stuckle on 12/07/07 02:36
Arne-Kolja Bachstein wrote:
> Hi Ciaran,
>
> thanks for your answer, but thats not my problem at all. Its the
> parsing of those string that names the menu nesting and the needed
> recursion.
>
> As its one string column in the db with simply "n.n.n" in it, i need
> to parse this using php to nest it in given ul levels. But I dont know
> how to solve this in the best way. So my question is basically not a
> syntax based, but rather a question for an idea on how to solve it.
>
> Greets
>
> Arne
>
> On Dec 7, 2:35 am, Ciaran <cronok...@hotmail.com> wrote:
>> Hi Arne,
>> If the data is coming from an SQL query, the usual way is to use the
>> mysql_fetch_array function as a while loop like so:
>>
>> while($data=mysql_fetch_array($mysql query result)){
>> echo "<ul>".$data['Title']."</ul>";
>> etc...
>>
>> }
>>
>> If you have to use the array you created instead of the fetch
>> function, you can use similar code inside a foreach loop like so:
>> (presuming it's a 3d array you're working with)
>>
>> foreach($arrayname as $data){
>> echo "<ul>".$data['Title']."</ul>";
>> etc...
>>
>> }
>>
>> Hope that helps you out! Have a look at php.net for documentation on
>> the functions/loops mentioned.
>> Ciarán
>
>
The way to solve it is to normalize your database. Your db fails first
normal form.
Try comp.databases.mysql for some help with redesigning your database.
Once that's done, the rest will be much easier.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|