I need help on how to deal with mysql database using wordpress

Discussion in 'Programming' started by tiffany.tomol, Apr 19, 2011.

  1. #1
    Hi everyone,

    I know how mysql database pretty much but my problem is how to use it in wordpress.

    For example, i have a form in my wordpress site, it contains username and email address. After the user inputs data and click submit how do i insert the username and email address to database?

    I created the form using Contact7 plugin and paste the generated code to a new page.

    Thank you. Any ideas or help is greatly appreciated.

    Tiffany
     
    tiffany.tomol, Apr 19, 2011 IP
  2. iliveforyou

    iliveforyou Active Member

    Messages:
    207
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    hi,
    you need an insert.php file, and this code in:

    <?php
    require_once('config.php');
    mysql_query("INSERT INTO your_table (username, email) VALUES ('$_POST[username]','$_POST')");
    ?>
     
    iliveforyou, Apr 24, 2011 IP