Urgent problem

Discussion in 'Programming' started by miniclipz, Dec 6, 2007.

  1. #1
    Anyone knows how i can do this:

    I have made a form: http://hotduels.com/doneaza/ - it's for a charity cause.
    I connected the fields to the database.
    How can i make the page to display what every users completed in the form?

    I mean, when someone completes the form, it will then appear on that same page.

    Nume... and all the other fields. ?

    Such as the guestbooks have.

    My SQL has 1 table (6 fields). Field_1 .... Field_6

    Thanks in advance,
    Vlad
     
    miniclipz, Dec 6, 2007 IP
  2. Gawk

    Gawk Peon

    Messages:
    427
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You will need to format the output to look nice and of course the page needs to be .php ;)

    $sql = mysql_query("select * from table_name");
    echo "<table>";
    while ($row = mysql_fetch_array($sql)) {
        echo "<tr>";
        echo "<td>" . $row["field_1"] . "</td>";
        echo "<td>" . $row["field_2"] . "</td>";
        echo "<td>" . $row["field_3"] . "</td>";
        echo "<td>" . $row["field_4"] . "</td>";
        echo "<td>" . $row["field_5"] . "</td>";   
        echo "<td>" . $row["field_6"] . "</td>";
        echo "</tr>";
    }
    echo "</table>";
    PHP:
     
    Gawk, Dec 6, 2007 IP
    miniclipz likes this.
  3. miniclipz

    miniclipz Well-Known Member

    Messages:
    1,043
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Problem solved. Thanks Gawk.
     
    miniclipz, Dec 6, 2007 IP