Jump to content

Problem in Displaying records


max_w1

Recommended Posts

hi,

i am trying to display recrods in a php page with a query like this:

 

$fighter = mysql_query ("SELECT `abc` 
FROM `tablename` 
WHERE`username` LIKE '$username'
LIMIT 0 , 30") or die(mysql_error());
 $myfighter = mysql_fetch_assoc($fighter);
echo "$myfighter['f_id']";

 

but it is displaying only one record how do id display all records which match this condition.

can anyone tell me how to display all records at once

Link to comment
https://forums.phpfreaks.com/topic/95206-problem-in-displaying-records/
Share on other sites

i am really upset with you guys >:(

 

i finally found the answer myself.

what i did is:

$result = mysql_query ("SELECT `abc` 
FROM `tablename` 
WHERE`username` LIKE '$username'
LIMIT 0 , 30") or die(mysql_error());
  $myresult = mysql_fetch_assoc($result);
while($myresult = mysql_fetch_assoc($result))
{
echo $myresult['f_id'];
}

KEEP UP THE GOOD WORK OF NOT HELPING!!!! :(>:( >:(

It's Sunday in most of the time zones on earth right now, so the number of people even reading posts is very low. You need to have enough patients to wait at least two hours from your original post for a reply.

 

Looping is a fundamental concept in all programming languages. Anyone who did read your post probably expected you to be able to figure out what the problem was.

 

Your final code will end up with one missing row of data because you are fetching an extra row in the line of code before your loop.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.