hi, am trying to perform a loop but cant manage to do it
hear is my code
$handle = db_connect();
$pages_sql = "select * from pages where code = 'news'";
$pages_result = $handle->query($pages_sql);
{
$story_sql = "select * from stories
where page = 'news'
and published is not null
order by published desc";
$story_result = $handle->query($story_sql);
}
while ($pages = $pages_result->fetch_assoc())
{
$story = $story_result->fetch_assoc();
echo "<tr>
<td bgcolor=#ffffff>
<b>{$pages['description']}</b>
<br><br>{$story['headline']}
<br>
<a href='page.php?page={$pages['code']}'>
Read more {$pages['code']} ...
</a>
</td>
<td>";
echo '</td></tr>';
}
this is the part that i am trying to loop
{
$story = $story_result->fetch_assoc();
echo "<tr>
<td bgcolor=#ffffff>
<b>{$pages['description']}</b>
<br><br>{$story['headline']}
<br>
<a href='page.php?page={$pages['code']}'>
Read more {$pages['code']} ...
</a>
</td>
<td>";
echo '</td></tr>';
}
i would like it looping 3 times.
i have tried several diffrent method but it messes thing up copleatly. as it is now it will only output the bit i want looping once.
i think it is this line what i need to alter
while ($pages = $pages_result->fetch_assoc())
but i keep getting compleatly lost despite me having a 944 page book infront of me to help me
thanks for any help
berrance