cheyner11 Posted March 15, 2006 Share Posted March 15, 2006 I need some help columizing data into three rows.what would the PHP code be to create a data print like the following:data A | data B | data CThanks for your help Quote Link to comment Share on other sites More sharing options...
greycap Posted March 15, 2006 Share Posted March 15, 2006 [!--quoteo(post=355235:date=Mar 15 2006, 12:13 AM:name=cheyner11)--][div class=\'quotetop\']QUOTE(cheyner11 @ Mar 15 2006, 12:13 AM) [snapback]355235[/snapback][/div][div class=\'quotemain\'][!--quotec--]I need some help columizing data into three rows.what would the PHP code be to create a data print like the following:data A | data B | data CThanks for your help[/quote][code]<?php$sql = "SELECT a, b, c FROM T";$result = mysql_query($sql) or die(mysql_error());print "<table>";while ($row = mysql_fetch_assoc($result) print "<tr><td> $row['a'] </td><td> $row['b'] </td> <td> $row['c']</td></tr>";print "</table>";?>[/code] Quote Link to comment Share on other sites More sharing options...
keeB Posted March 15, 2006 Share Posted March 15, 2006 .. Not nearly enough info on what you need to have done..Here you go?[code]$x = "hi"; $y = "to";$z = "you";print "$x | $y | $z";[/code] Quote Link to comment Share on other sites More sharing options...
cheyner11 Posted March 17, 2006 Author Share Posted March 17, 2006 sorry. I mean that I need the data to be columnized into three rows, whereas there is no limit to the amount of data. So if there were 8 rows in a database, I would need it to print:Row 1 | Row 2 | Row 3Row 4 | Row 5 | Row 6Row 7 | Row 8 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.