ashoklakhnavi Posted September 17, 2012 Share Posted September 17, 2012 I have written a web page in php, bellow is the code: <?php mysql_connect('localhost','root','') or die(mysql_error());mysql_select_db("resource_resource") or die(mysql_error());$data = mysql_query("SELECT * FROM categories") or die (mysql_error()); while($info = mysql_fetch_array( $data )){echo "<p><a href=".$info['catname'].">".$info['catname'] ."</a> ";}echo "</p>"; ?> This displays data in very long column, Now I want display few data (eg. 50) in a column and rest are in next column and then next.please suggest me the string Link to comment Share on other sites More sharing options...
niche Posted September 17, 2012 Share Posted September 17, 2012 Float two columns next to each other and fill each column with a while loop that has a counter. Link to comment Share on other sites More sharing options...
thescientist Posted September 20, 2012 Share Posted September 20, 2012 or, as you output the data, start it in a div, or suitable tag/container. when you get halfway, based on the total amount of data, close the current element/tag/container/etc, and start a new one for the rest of the data. as for getting them to sit side by side, that just takes a little CSS. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now