SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Member
    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

  2. #2
    SitePoint Wizard creole's Avatar
    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

  3. #3
    I'm a college yuppie now! sbdi's Avatar
    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

  4. #4
    SitePoint Wizard creole's Avatar
    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

  5. #5
    web daemon jorasmi's Avatar
    Join Date
    Nov 2001
    Location
    Philippines
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what programming language? and what database is it MSSQLServer or MySQL

  6. #6
    SitePoint Member
    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

  7. #7
    (****** or Deleted)
    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>
    Try it

    You'll need to change the code to work with your own, but this is how to do it


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •