View Single Post
  #1 (permalink)  
Old 11-22-03, 01:34 AM
simone's Avatar
simone simone is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
php code not pulling data from DB

ok im creating a guestbook and i want to print the array of messeges on my php page. This is the code im using to do so, i get no errors however it's not pulling any of the data from that table in my database. I do have an entry in the DB, so im not trying to retrieve nothing
Code:
<?

include("config.php");


$query = "SELECT id, subject, name, email, site, aim, yim, msn, msg, date, ip FROM eight order by id DESC LIMIT 15";
$result = mysql_query($query);

echo "<br><table align='center' width='75%' cellpadding='4' cellspacing='1' bgcolor='#000000'>";

while($r=mysql_fetch_array($result));
{

echo "<tr>";
echo "<td bgcolor='#FFFFFF'>$r[msg]</td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor='#FFFFFF'>Posted By: <a href='mailto:$r[email]'>$r[name]</a> $r[date]</td>";
echo "</tr>"; 
}
echo "</table>"; 

?>
I havent finished entering everything i want to pull yet, thats why theres a tonne of selects and hardly any show results. so any help guys?

Last edited by simone; 11-22-03 at 01:39 AM.
Reply With Quote