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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.