Please see the following code. the results can be seen on my website - once you have registered change the path to /gossip_db.php
The problem is that only one result is shown. Where did I go wrong?
<?php
$db = "gossipTable";
$link = mysql_connect( "localhost:/users/rupertbj/domains/rupertbj.co.uk/sql/mysql.sock", "root" );
if ( !$link ) die( "Couldn't connect to MySQL" );
mysql_select_db( $db, $link ) or die( "Couldn't open $db: ".mysql_error() );
$sql = "SELECT * FROM gossip";
$result = mysql_query( $sql, $link );
while ( $newArray = mysql_fetch_array($result) )
{
$id = $newArray['id'];
$name = $newArray['name'];
$user = $newArray['user'];
$gossip = $newArray['gossip'];
}
print "$name<br><a href=\"mailto:$user\">$user</a><br>$gossip<br><hr><br>";
mysql_close( $link );
?>