dazzclub Posted September 10, 2008 Share Posted September 10, 2008 I trying to retrieve a row of data from my table using this code <?php $q ="SELECT * FROM press_material ORDER BY id"; if($return = mysqli_query($dbc, $q)) { while($row = mysqli_fetch_array($return, MYSQLI_ASSOC)) $publication = $row['publication']; $date = $row['date']; $content = $row['content']; } ?> and im using this html code to display it <p>|<?php echo $publication; ?></p> <p><?php echo $date; ?> </p> <p><?php echo $content; ?></p> The problem is that it seems to display one row, which will $publication and it ignores the rest. Can any one point me in the right direction please? cheers Darren Link to comment https://forums.phpfreaks.com/topic/123605-mysqli_fetch_array-question/ Share on other sites More sharing options...
BlueSkyIS Posted September 10, 2008 Share Posted September 10, 2008 you need to echo those values inside the while loop. otherwise, you're just doing it once, after the loop has gone over all the records. Link to comment https://forums.phpfreaks.com/topic/123605-mysqli_fetch_array-question/#findComment-638319 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.