getting html form to submit to data base

Discussion in 'HTML & Website Design' started by ScottDB, May 23, 2011.

  1. #1
    Hi I am just learning php and sql. I know how to add a data base, table, and make a php page and pull info from the data base. Now I am trying to figure out how to add information to the data base from an html form. Not sure if html forms are best or if there is any other way of making a simple signup form.

    Have looked through tutorials and saw three different ways of doing this and none of the tutorials were very explanitory on how to do this.

    Attached is a simple signup form that I am trying to use to submit to database.

    Can someone direct me to a great tutorial for this or explain it themself?
     

    Attached Files:

    ScottDB, May 23, 2011 IP
  2. karthimx

    karthimx Prominent Member

    Messages:
    4,959
    Likes Received:
    127
    Best Answers:
    2
    Trophy Points:
    340
    #2
    function CreateTable()
    {
    $qry = "Create Table $this->tablename (".
    "id_user INT NOT NULL AUTO_INCREMENT ,".
    "name VARCHAR( 128 ) NOT NULL ,".
    "email VARCHAR( 64 ) NOT NULL ,".
    "phone_number VARCHAR( 16 ) NOT NULL ,".
    "username VARCHAR( 16 ) NOT NULL ,".
    "password VARCHAR( 32 ) NOT NULL ,".
    "confirmcode VARCHAR(32) ,".
    "PRIMARY KEY ( id_user )".
    ")";

    if(!mysql_query($qry,$this->connection))
    {
    $this->HandleDBError("Error creating the table \nquery was\n $qry");
    return false;
    }
    return true;
    }

    more info: http://www.html-form-guide.com/php-form/php-registration-form.html
     
    karthimx, May 23, 2011 IP