Jump to content

Display results in multiple colums


mdmogren

Recommended Posts

I am pulling some info from a mysql table, checking some logic, and displaying in on a page. The way this is written now it shows all of the items in a one column table, I simply want to break it up into multiple columns (ideally by specifying say 20 items per column). I know I need a counter and a loop but I'm just not sure how it all fits in with my existing program. Any help would be greatly appreciated.

 

Here is my code

$result2 = mysql_query("SELECT * FROM propertyids ORDER BY propertyname ASC");
while($row2 = mysql_fetch_array($result2)){
${'resp'.$row2['id']} = curl_multi_getcontent(${'ch'.$row2['id']});
${'status'.$row2['id']} = strpos(${'resp'.$row2['id']},$httpvar);
if(${'status'.$row2['id']} === false) {
echo "<tr><td>";
echo "<img src='images/down.png'> <a href='" . $row2['primaryurl'] . "' target='_blank'>" . $row2['propertyname'] . "</a>";
echo "</td></tr>";
}
else {
echo "<tr><td>";
echo "<img src='images/up.png'> <a href='" . $row2['primaryurl'] . "' target='_blank'>" . $row2['propertyname'] . "</a>";
echo "</td></tr>";
}
}
echo "</td></table>";

Link to comment
https://forums.phpfreaks.com/topic/233645-display-results-in-multiple-colums/
Share on other sites

This mostly makes sense to me but I'm still not sure where to put in which pieces of code, if someone could do the work for me or explain in a little more detail it would be greatly appreciated. Not trying to be lazy but I've been messing with this for hours and I know someone who knows what they're doing can probably type it up in 3 mins.

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.