www.webdeveloper.com
Results 1 to 3 of 3

Thread: Print out the contents of this table

  1. #1
    Join Date
    Sep 2010
    Posts
    64

    Print out the contents of this table

    In table1 I have 5 colums of data: idt(primary key), datetime, col1, col2 and col3. I would like to print out the contents of this table.


    Code:
    "SELECT * FROM [table1];"
    PHP Code:
    echo "<center><table>"
    while count($data['idt']) {
    echo 
    "<tr><td>"
    echo $data['idt']
    echo 
    "</td></tr><tr><td>"
    $data['datetime']
    echo 
    "</td></tr><tr><td>"
    $data['col1']
    echo echo 
    "</td></tr><tr><td>"
    echo $data['col2']
    echo 
    "</td></tr><tr><td>"
    echo $data['col3']
    echo 
    "</td></tr>"
    }
    echo 
    "</table></center>" 

  2. #2
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,843
    table from what database engine; MySQL, SQLite, PostgreSQL, MsSQL, etc.?

    every line of your php code has syntax errors btw...
    Last edited by ShrineDesigns; 05-23-2014 at 07:27 AM.

  3. #3
    Join Date
    Sep 2010
    Posts
    64
    MySQL

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles