I have a sql table with 12 items and need to have them printed out in colums so they are easier to read
| SitePoint Sponsor |
I have a sql table with 12 items and need to have them printed out in colums so they are easier to read





If you're using command line then:
SELECT * from table_name
will display the contents of your TABLE in rows and columsn like a spreadsheet.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes





Wouldnt you need something to output the tables now ? What languages can you use ?
Back Again





Not if he's using command line.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
what programming language? and what database is it MSSQLServer or MySQL
I am using php am html to show the results
They are comming out correctly but I have problems combining the php and html to show clumns


Try the following:
Try itPHP Code:<html>
<head>
</head>
<body>
<table>
<tr>
<?php
$result = @mysql_query("select statement goes here);
if (!$result)
{
echo ("<div align=\"left\">Error performing query: " . mysql_error() . "</div>");
exit ();
}
while ($row = mysql_fetch_row($result))
{
?>
<td>
<?php echo "$row['var']"; ?>
</td>
<?php
}
?>
</tr>
</table>
</body>
</html>
You'll need to change the code to work with your own, but this is how to do it![]()
Bookmarks