I would like to select all the rows from a table that share the same value in a certain field. Example: [B]username[/B] [B]message[/B] bob hello jim howdy susan hi jim hey Code (markup): I know how to select one row: "SELECT message FROM users WHERE username = 'jim'" Code (markup): but I would like to select all rows where the username is 'jim' and echo them out. So in this example, it would display 'howdy' and 'hey'. Any help is appreciated as always, thanks.
<?php $sql = mysql_query("SELECT message FROM users WHERE username = 'jim'"); while($row = mysql_fetch_array($sql)){ echo $row['message']; } ?> Code (php):