Current location: Hot Scripts Forums » Programming Languages » PHP » php code not pulling data from DB


php code not pulling data from DB

Reply
  #1 (permalink)  
Old 11-22-03, 02: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 02:39 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-22-03, 03:08 AM
simone's Avatar
simone simone is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
never mind guys, i worked out i dont need the ; at the end of the fetch array
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code to edit a text file mdhall Script Requests 12 12-23-10 05:03 AM
protecting code in PHP ckb PHP 12 01-02-04 09:53 AM
one-page form/catalog in php, data fed in with .csv file? domaky PHP 2 10-25-03 10:32 AM
help plz: format retrieved Mysql data in HTML with PHP paulj000 PHP 2 10-19-03 09:03 PM


All times are GMT -5. The time now is 01:09 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.