TecTao Posted July 25, 2011 Share Posted July 25, 2011 I've found a couple of tutorials but can't seem to get them to work correctly. Tying to get the results of this query into 3 columns. <?php $result = mysql_query( "SELECT * FROM manufacturers ORDER BY mfg_name ASC" ) or die("SELECT Error: ".mysql_error()); $num_rows = mysql_num_rows($result); while ($row = mysql_fetch_array($result)) { extract($row); echo "<a href= " . $web_html . " target= _blank class=linecard>" . $mfg_name . "</a></br>"; $row_count++; } mysql_close; ?> Thanks for any help in advance. Mike Quote Link to comment https://forums.phpfreaks.com/topic/242769-need-help-creating-3-columns-from-a-simple-query-array/ Share on other sites More sharing options...
TeNDoLLA Posted July 25, 2011 Share Posted July 25, 2011 So how it is not working correctly? Any errors? And what is the $row_count variable that you are incrementing inside the loop? It is not defined anywhere or used for anything? Quote Link to comment https://forums.phpfreaks.com/topic/242769-need-help-creating-3-columns-from-a-simple-query-array/#findComment-1246908 Share on other sites More sharing options...
TecTao Posted July 25, 2011 Author Share Posted July 25, 2011 Sorry, this is the original query that is producing one long column. I'm looking create 3 columns. Quote Link to comment https://forums.phpfreaks.com/topic/242769-need-help-creating-3-columns-from-a-simple-query-array/#findComment-1246913 Share on other sites More sharing options...
wildteen88 Posted July 25, 2011 Share Posted July 25, 2011 Have a look at this thread for ideas http://www.phpfreaks.com/forums/index.php?topic=95426.0 Quote Link to comment https://forums.phpfreaks.com/topic/242769-need-help-creating-3-columns-from-a-simple-query-array/#findComment-1246930 Share on other sites More sharing options...
TecTao Posted July 25, 2011 Author Share Posted July 25, 2011 Thanks for the link. That worked perfect, was able to create the hyperlink code to the different company websites and all. Quote Link to comment https://forums.phpfreaks.com/topic/242769-need-help-creating-3-columns-from-a-simple-query-array/#findComment-1246974 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.