creating tables in php

Discussion in 'PHP' started by Hussy, Jul 1, 2010.

  1. #1
    Hi....


    how can we create tables in php, i have been searching on google but couldn't find relevant material plz help guys, thanks in advance.




    waiting your reply friend
     
    Hussy, Jul 1, 2010 IP
  2. Triggs

    Triggs Active Member

    Messages:
    84
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #2
    Try looking here first http://www.w3schools.com/php/php_mysql_create.asp

    It would be better to create tables through phpMyAdmin or something, unless you need dynamic tables for some reason.
     
    Triggs, Jul 1, 2010 IP
  3. jam4517549

    jam4517549 Member

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    what are u asking for, HTML tables or DATABASE table?
     
    jam4517549, Jul 1, 2010 IP
  4. Triggs

    Triggs Active Member

    Messages:
    84
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #4
    eh, I didn't think of that.
    If you mean HTML Tables, all you need to do is use echo.

    
    echo '<table><tr><td>test</td></td></table>';
    
    PHP:
     
    Triggs, Jul 1, 2010 IP
  5. kaviarasankk

    kaviarasankk Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    echo '<table>';
    echo '<tr>';

    while(){
    echo ''<td> ur content</td>';
    }
    echo '</tr>';
    echo '</table>';



    or


    echo '<table>';

    while(){
    echo '<tr>';
    echo ''<td> ur content</td>';
    echo '</tr>';
    }
    echo '</table>';
     
    kaviarasankk, Jul 3, 2010 IP
  6. arunsinghrawat

    arunsinghrawat Greenhorn

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    You ca create table in PHP same as in HTML
    but you have to place them between echo " here is your table code";
     
    arunsinghrawat, Jul 3, 2010 IP
  7. strgraphics

    strgraphics Active Member

    Messages:
    710
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #7
    just use normal html, and echo it or print, thats it.
    No special arrangement done for tables in php
     
    strgraphics, Jul 3, 2010 IP
  8. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #8
    There's lots of ways to create tables in PHP as kaviarasankk have demonstrated - just choose the best one that suits your need.
     
    Rainulf, Jul 3, 2010 IP
  9. seofast

    seofast Guest

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    The CREATE TABLE statement is used to create a table in MySQL.

    Syntax

     
    seofast, Jul 4, 2010 IP
  10. seofast

    seofast Guest

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The CREATE TABLE statement is used to create a table in MySQL.

    Syntax

     
    seofast, Jul 4, 2010 IP
  11. strgraphics

    strgraphics Active Member

    Messages:
    710
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #11
    Oops...!!! he is not asking database tables...!!!!

     
    strgraphics, Jul 4, 2010 IP
  12. vocongdanh

    vocongdanh Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #12
    Invalid !
    
    echo '<table><tr><td>test</td></tr></table>';
    
    PHP:
    :D
     
    vocongdanh, Jul 6, 2010 IP