richiejones24 Posted November 3, 2011 Share Posted November 3, 2011 need a little help guys! I use the script below to display profile images, trouble is it shows 1 on top of the other, and i need it to double up 2 profile images on top of 2 profile images ect any ideas how i can do this. require("./include/mysqldb.php"); $con = mysql_connect("$dbhost","$dbuser","$dbpass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$dbame", $con); $result = mysql_query("SELECT * FROM Search_profiles_up WHERE upgrade_one ='1' ORDER BY RAND() LIMIT 40"); print "<table width=\"293\" height=\"111\" border=\"0\"> <tr>\n"; while($row = mysql_fetch_array($result)) { print "<td width=\"142\"><img src=" . $row['search_small_image'] . " width=\"144\" height=\"169\" /></td>\n"; print " </tr>\n"; print " <tr> \n"; print "<td>" . $row['star'] . "</td>\n"; print " </tr>\n"; print " <tr>\n"; print "<td>" . $row['username_search'] . "</td>\n"; print " </tr>\n"; print " <tr> \n"; print "<td>" . $row['phone_search'] . "</td>\n"; print " </tr> \n"; } print "</table>"; mysql_close($con); ?> Quote Link to comment https://forums.phpfreaks.com/topic/250407-displaying-mysql-results-table-side-by-side/ Share on other sites More sharing options...
Caliber Mengsk Posted November 3, 2011 Share Posted November 3, 2011 Not certain what you mean. You didn't really describe it the best. Image reference maybe of what you want? (Can be basic and quick, made in mspaint or something) Are you effectively wanting profile images like this but you are getting them like this Quote Link to comment https://forums.phpfreaks.com/topic/250407-displaying-mysql-results-table-side-by-side/#findComment-1284783 Share on other sites More sharing options...
The Little Guy Posted November 3, 2011 Share Posted November 3, 2011 Or do you want them kinda like this? [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/250407-displaying-mysql-results-table-side-by-side/#findComment-1284784 Share on other sites More sharing options...
richiejones24 Posted November 3, 2011 Author Share Posted November 3, 2011 Sorry for not being more clear at the moment the script displays images like this and i need it to display images like this 8) 8) 8) 8) 8) Quote Link to comment https://forums.phpfreaks.com/topic/250407-displaying-mysql-results-table-side-by-side/#findComment-1284790 Share on other sites More sharing options...
Caliber Mengsk Posted November 3, 2011 Share Posted November 3, 2011 Try this: <?php require("./include/mysqldb.php"); $con = mysql_connect("$dbhost","$dbuser","$dbpass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$dbame", $con); $result = mysql_query("SELECT * FROM Search_profiles_up WHERE upgrade_one ='1' ORDER BY RAND() LIMIT 40"); print "<table width=\"293\" height=\"111\" border=\"0\"> <tr>"; $right = false; while($row = mysql_fetch_array($result)) { print "<td width=\"142\"><img src=" . $row['search_small_image'] . " width=\"144\" height=\"169\" /><br />"; . $row['star'] . "<br />" . $row['username_search'] . "<br />"; . $row['phone_search'] . "</td>"; if($right) { print "</tr><tr>"; } $right=!$right; } print "</tr></table>"; mysql_close($con); ?> Quote Link to comment https://forums.phpfreaks.com/topic/250407-displaying-mysql-results-table-side-by-side/#findComment-1284795 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.