paulman888888 Posted June 2, 2008 Share Posted June 2, 2008 Is there a way to echo out all the data in a mysql table? Thankyou Link to comment https://forums.phpfreaks.com/topic/108411-solved-is-there-a-way/ Share on other sites More sharing options...
dezkit Posted June 2, 2008 Share Posted June 2, 2008 yes Link to comment https://forums.phpfreaks.com/topic/108411-solved-is-there-a-way/#findComment-555767 Share on other sites More sharing options...
paulman888888 Posted June 2, 2008 Author Share Posted June 2, 2008 and can you tell me please? Link to comment https://forums.phpfreaks.com/topic/108411-solved-is-there-a-way/#findComment-555771 Share on other sites More sharing options...
dezkit Posted June 2, 2008 Share Posted June 2, 2008 <?php mysql_connect("localhost", "", "") or die(mysql_error()); $query = "SELECT * FROM example"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['table_name']; echo "<br>"; } ?> lol Link to comment https://forums.phpfreaks.com/topic/108411-solved-is-there-a-way/#findComment-555775 Share on other sites More sharing options...
discomatt Posted June 2, 2008 Share Posted June 2, 2008 $q = 'SELECT * FROM `table`'; $r = mysql_query($q); while ( $row = mysql_fetch_assoc( $r ) ) echo implode( ', ', $row ) . '<br />'; Check manual next time please. Plenty of basic questions are answered with examples shown. Link to comment https://forums.phpfreaks.com/topic/108411-solved-is-there-a-way/#findComment-555777 Share on other sites More sharing options...
rhodesa Posted June 2, 2008 Share Posted June 2, 2008 as an html table: $result = mysql_query("SELECT * FROM tablename"); print '<table>'; while($row = mysql_fetch_assoc($result)){ print '<tr><td>'.implode('</td><td>',$row).'</td></tr>'; } print '</table>'; Link to comment https://forums.phpfreaks.com/topic/108411-solved-is-there-a-way/#findComment-555779 Share on other sites More sharing options...
paulman888888 Posted June 2, 2008 Author Share Posted June 2, 2008 thankyou Link to comment https://forums.phpfreaks.com/topic/108411-solved-is-there-a-way/#findComment-555785 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.