48 users online (0 members and 48 guests)  


  Results 1 to 2 of 2

Related

  1. Replies: 1
  2. html form data output    Forum: HTML Forum
    Replies: 1
  3. Get data in same HTML page    Forum: HTML Forum
    Replies: 1
  4. javascript should be displayed in html    Forum: HTML Forum
    Replies: 0
  5. How to parse displayed text from HTML code?    Forum: CGI Perl Forum
    Replies: 3
  1. #1
    amyr61's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2010
    Posts
    1

    form data displayed on html page

    I have a form which currently sends me an email with the input data, and I manually enter the data on a webpage. What I want to achieve is for MySql to send the data to be displayed in a table on a webpage.

    I am going to put this up for bid on Rent-a-Coder.com, but am not sure what basically is involved so I can accurately submit a bid. I know a database and tables need to be created in MySql, but after that I don't know.

    Can anyone just give me the highlights? Thanks!

  2. #2
    Yesideez's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2010
    Location
    Devon, UK
    Posts
    8

    Re: form data displayed on html page

    Once the data has been submitted by the user you'll need to have your script enter it into a database using the INSERT command. For example...

    PHP Code:
    mysql_query("INSERT INTO contacts SET firstname='".$strFirstName."',lastname='".$strLastName."'"); 
    Once there you'll need another script to run a SELECT query on the database to pull out the data that you want. If more than one record is being retrieved then you'll need a loop to build HTML - best to use a table for this.

    PHP Code:
    $query=mysql_query("SELECT * FROM contacts");
    while (
    $row=mysql_fetch_assoc($query)) {
      echo 
    '<tr><td>'.$row['firstname'].'</td><td>'.$row['lastname'].'</td></tr>';

    Last edited by Yesideez; 08-01-2010 at 12:55 PM. Reason: Adding INSERT example