Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rpapaiof
    New Member
    • Oct 2006
    • 27

    Table

    im just a beginer in php
    i have some problems
    i have to make a table with 6 row and 7 column then in each row include a name family name and birthday also user name and pass for them .
    i have tried it but i have some problems will someone help me find a way ?please
  • khalidbaloch
    New Member
    • Oct 2006
    • 61

    #2
    you did tell us that what kind of table you want to make ..
    sql database table or
    html table ?

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      For such a simple (MySQL I presume?) table it is easier to use phpMyAdmin. It's only 6 rows so why write a program to do that? Unless you want to expand in the future.

      Ronald :cool:

      Comment

      • rpapaiof
        New Member
        • Oct 2006
        • 27

        #4
        Originally posted by khalidbaloch
        you did tell us that what kind of table you want to make ..
        sql database table or
        html table ?
        its a html table my friend

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          And filling it from PHP variables? Please describe it a bit more, because all I know now is that you want PHP to echo an HTML <table> with 6 rows <tr> and each row 7 cells <td>. As in
          [php]
          echo "<table>
          <tr>
          <td>name</td>
          <td>age</td>
          <td>birthday</td>
          <td>address</td>
          <td>city</td>
          <td>userid</td>
          <td>password</td>
          </tr>
          </table>";
          [/php]
          But how do you fill that table with the data? Is it from PHP variables, constants, how ?

          Ronald :cool:

          Comment

          • rpapaiof
            New Member
            • Oct 2006
            • 27

            #6
            Originally posted by ronverdonk
            And filling it from PHP variables? Please describe it a bit more, because all I know now is that you want PHP to echo an HTML <table> with 6 rows <tr> and each row 7 cells <td>. As in
            [php]
            echo "<table>
            <tr>
            <td>name</td>
            <td>age</td>
            <td>birthday</td>
            <td>address</td>
            <td>city</td>
            <td>userid</td>
            <td>password</td>
            </tr>
            </table>";
            [/php]
            But how do you fill that table with the data? Is it from PHP variables, constants, how ?

            Ronald :cool:
            we have a txt file that include users info we have to read that info and print it in correct place in our table also a number for each row .

            Comment

            • ronverdonk
              Recognized Expert Specialist
              • Jul 2006
              • 4259

              #7
              Originally posted by rpapaiof
              we have a txt file that include users info we have to read that info and print it in correct place in our table also a number for each row .
              We can only advise with some sensible code when we know the layout of each text record in your file. We cannot guess at that! So show that layout.

              Ronald :cool:

              Comment

              • rpapaiof
                New Member
                • Oct 2006
                • 27

                #8
                Originally posted by ronverdonk
                We can only advise with some sensible code when we know the layout of each text record in your file. We cannot guess at that! So show that layout.

                Ronald :cool:
                No Name Family Name User Password Birthday
                1
                2
                3
                4
                5
                6



                In text file which we have there is 6 person names and their info


                1.kevin any text User1 002525 02.21.55
                2.katy any text User1 002524 02.21.55
                3.lora any text User1 002523 02.21.55
                4.mark any text User1 002522 02.21.55
                5.jenny any text User1 002521 02.21.55
                6.john any text User1 002520 02.21.55


                the text file must be used with openfile and the info of that file must be printed in correct place on the table

                Comment

                • ronverdonk
                  Recognized Expert Specialist
                  • Jul 2006
                  • 4259

                  #9
                  Seeing your text record layout I still have 3 questions:

                  1. is the separator between the text fields just a blank character or a comma or anything else?
                  2. does field 'any name' contain any character INCLUDING BLANKS?
                  3. can any other field contain embedded blanks?

                  If you have no field separator (other then blank) and that 'any name' field can contain blanks, the only way to solve this is parse the name from the start of the string. Parse the userid, password and birthday from the end of the string, and wqhat is left is then the family name.
                  If you have no field separator (other then blank) and all fields can contain blanks, you're in trouble, becasuse there is no way you can distinguish between the various fields.

                  Ronald :cool:

                  Comment

                  • rpapaiof
                    New Member
                    • Oct 2006
                    • 27

                    #10
                    Originally posted by ronverdonk
                    Seeing your text record layout I still have 3 questions:

                    1. is the separator between the text fields just a blank character or a comma or anything else?
                    2. does field 'any name' contain any character INCLUDING BLANKS?
                    3. can any other field contain embedded blanks?

                    If you have no field separator (other then blank) and that 'any name' field can contain blanks, the only way to solve this is parse the name from the start of the string. Parse the userid, password and birthday from the end of the string, and wqhat is left is then the family name.
                    If you have no field separator (other then blank) and all fields can contain blanks, you're in trouble, becasuse there is no way you can distinguish between the various fields.

                    Ronald :cool:
                    1.there is nothing beetween them
                    2.about second just put a text as the way u want it must be printed in family name column.
                    3.yes they can

                    Comment

                    • ronverdonk
                      Recognized Expert Specialist
                      • Jul 2006
                      • 4259

                      #11
                      So you have an entire and completely unstructured set of data that must be put correctly in a table!
                      Then see my last reply about this situation
                      Originally posted by ronverdonk
                      If you have no field separator (other then blank) and all fields can contain blanks, you're in trouble, becasuse there is no way you can distinguish between the various fields.
                      Ronald :cool:

                      Comment

                      Working...