Jump to content

printing results from query


jacko_162

Recommended Posts

i am trying to print results from a mysql query, which works and displays.

 

what i was wondering is how i can echo my results in a table, but limit the amount of colums to 5 before starting a new line?

 

if that makes sense..

 

here is my working query;

 

                                       <?
// initiate query
$results = mysql_query("SELECT * FROM tests WHERE member_id='$_SESSION[sESS_MEMBER_ID]' ORDER BY id DESC LIMIT $page, $limit");
while ($data = mysql_fetch_array($results))
{
?>
<td><?=$data["day"]?></td>
<? } ?>

my $limit array is currently set at 20 which would be fine if i wanted to display each result in a row but as i want columns 20 columns across makes the page too wide, so i wanted to set it to show 5 colums accross, then start a new line with another 5 and so on.

how can i code this differently.

many thanks for the help guys,
love this place 

Link to comment
https://forums.phpfreaks.com/topic/195151-printing-results-from-query/
Share on other sites

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.