Hi,

I think it will just hit the same wall (if there is only one (or n*3+1) topic).
This may help a bit:

$i = 0;
while ($list && $list->fetch() {
        if ($i++  == 0) { echo "<tr>"; }
        ?><td align="left" valign="top">
        <a href="&(list.id);.html">&(topic.name);
        </a></td><?php 
        if ($i <= $x_in_a_row) { echo "</tr>"; $i = 0; }
}
if ($i > 0) {
        for ($j=$i; $j <$x_in_a_row) { echo "<td> </td>"; }
        echo "</tr>";
}

Well, the question remains, why $list->fetch() should leads to segfault and not
just return null/0/or_any_thing_else?

Regards

Gunardi Wu


> > I can't figure out why the 'if' condition lead to segfault. As the symptom does
> > not occur when there are 3 (or n*3) subtopics, is there any possibility that
> > the $list->fetch() will cause an segfault if the $list itself has already
> > reached its end, or ...?
> 
> It seems so. Hmm. Replace the loop with
> 
> for ($eol = 0, $x=1; $x < $x_in_a_row; $x++)
> {
>   ?><td align="left" valign="top"><?php
> 
>   if ($eol) { echo " </td>"; continue; }
> 
>   if ($list->fetch())
>   {
>     ?><a href="&(list.id);.html" >&(topic.name);</a><?php
>   } else { $eol = 1; echo " "; }
> 
>   echo "</td>";
> }
> 
> I've added this to the tutorial so it should be visible online soon.
> 
> Bye,
> Emile

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to