Suggest me..

Discussion in 'PHP' started by recruitermatenetworking, Nov 24, 2010.

  1. #1
    How To Create a Table in PHP?
     
    recruitermatenetworking, Nov 24, 2010 IP
  2. samyak

    samyak Active Member

    Messages:
    280
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    90
    #2
    Do you mean database table or HTML table tags?
     
    samyak, Nov 24, 2010 IP
  3. imocoder

    imocoder Member

    Messages:
    45
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Here are 2 examples.
    Create an HTML table in PHP:
    echo '
    <table align="center" width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>HTML table created in PHP</td>
    </tr>
    </table>
    ';
    PHP:
    Create a MySQL table in PHP:
    mysql_query("
    CREATE TABLE IF NOT EXISTS `db_table` (
      `optionid` bigint(20) unsigned NOT NULL,
      `option_name` varchar(20) NOT NULL default ''
    );
    ");
    PHP:
     
    imocoder, Nov 25, 2010 IP