If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > retrieving my data newb :(

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-20-04, 14:55
bud_etd_crib bud_etd_crib is offline
Registered User
 
Join Date: Jun 2004
Posts: 1
Unhappy retrieving my data newb :(

well ive got my database set up an stuff an my form sends it to the mysql database then on the page i want to print my results it wont print the first one unless i put a second one in can someone correct my script if its wrong

<?php
$conn = mysql_connect("localhost", "username");
mysql_select_db("databasename", $conn);

$upd = mysql_query("SELECT admin, date, title, comments FROM base order by id desc limit 10");
while ($row = mysql_fetch_row($upd))
while ($article = mysql_fetch_array($upd))
{

echo
'<table border=1 width=400 align=center>
<tr>
<td><LEFT><p>'.$article["admin"].'</p></LEFT>
</td>
<td><RIGHT><p>'.$article["date"].'</p></RIGHT>
</td>
</tr>
<tr>
<td colspan=2><p>'.$article["title"].'</p>
</td>
</tr>
<tr>
<td colspan=2><p>'.$article["comments"].'</p>
</td>
</tr>
</table><br><br>';
}

?>

someone reply plzzzzzz in need of help
Reply With Quote
  #2 (permalink)  
Old 06-20-04, 17:02
kukusz kukusz is offline
Registered User
 
Join Date: Jun 2004
Posts: 7
I would assume your first while loop just loops within itself and always just ends on the last record. Why don't you put some {} around it and entire other one, no?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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