I have a sql table with 12 items and need to have them printed out in colums so they are easier to read
Printable View
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.
Wouldnt you need something to output the tables now ? What languages can you use ?
Not if he's using command line.
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 it :)PHP 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 :)