WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] cannot add data to tables!! please help! (1 post)

  1. mostfamiliar
    Member
    Posted 5 years ago #

    I cannot get data added to my plugin tables from a form. I've tried just about everything. I am able to submit the data but nothing happens and I get no errors or anything. The values are the same as the form input type
    names.
    Here's the code:
    <?php
    global $wpdb;

    if(isset($_POST['submit'])){

    if ($wpdb->query("INSERT INTO ".$wpdb->prefix."release_table ( artist_name , title , release_date , label_id , format , buy_url , 'info' ) VALUES ( '".artist_name."', '".title."', '".release_date."', '".label_id."', '".format."', '".buy_url."', '".format."' );")) {
    echo "<p align='center'>".TXT_WPSC_COUPONHASBEENADDED."</p>";
    include_once('wp-config.php');
    include_once('wp-includes/wp-db.php');

    }
    }

    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic