SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Output in tables
-
May 15, 2002, 12:01 #1
- Join Date
- May 2002
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Output in tables
I have a sql table with 12 items and need to have them printed out in colums so they are easier to read
-
May 15, 2002, 12:26 #2
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
May 15, 2002, 16:09 #3
- Join Date
- Jul 2000
- Location
- Dublin , Ireland
- Posts
- 1,271
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Wouldnt you need something to output the tables now ? What languages can you use ?
Back Again
-
May 15, 2002, 17:15 #4
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
May 15, 2002, 21:55 #5
what programming language? and what database is it MSSQLServer or MySQL
-
May 15, 2002, 22:25 #6
- Join Date
- May 2002
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
sql tables
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
-
May 15, 2002, 23:00 #7
- Join Date
- May 2002
- Location
- Melbourne, Australia
- Posts
- 299
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try the following:
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
Bookmarks