Jump to content

PHP / CSS formatting?


Ancoats

Recommended Posts

Hey guys

 

I have a problem, basically I have a content area which spits out some PHP code from a database (name and picture) and the code I have used for this which shows the results

 

<?php

//call name and member pic from memberprofile table
$sql = "SELECT * FROM memberprofile ORDER BY memberID";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);

$i = 0;

//get all rows
while ($i < $rows)
{

$memberID = mysql_result($result, $i, "memberID");
$firstname = mysql_result($result, $i, "firstname");
$lastname = mysql_result($result, $i, "lastname");
$userPic = mysql_result($result, $i, "imagefile");



//echos the results
echo "<h3>$firstname $lastname</h3>\n";
//echo "<p>Last Name: $lastname</p>\n";
echo "<p><a href=\"viewprofile.php?profile=$memberID\"><img src=\"$userPic\"  border=\"0\"></a></p>\n";
//echo $userPic;

$i ++;
}

?>

 

Now, using increments, the data is displayed on individual lines and puts my page pagination out of whack, and I want a row of '3 individual' profiles to be displayed before a next row of 3 profiles, rather the current one row of one profile. How would I do this?

 

is this a CSS or PHP issue?

Link to comment
https://forums.phpfreaks.com/topic/150144-php-css-formatting/
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.