Ancoats Posted March 19, 2009 Share Posted March 19, 2009 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? Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted March 19, 2009 Share Posted March 19, 2009 How wide is the containing div? How wide are the images? Placing the images inside <p> tags isn't a good idea. Use floats instead. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.