WordPress.org

Support

Support » Plugins and Hacks » Hacks » Help me with inserting info into Databse

Help me with inserting info into Databse

  • Hello.
    (The table name is not the real one)

    I am trying to get a vote-system for comments.
    In the following mysql-query the comment_ID is added to the database.
    This is achieved with $commentid = get_comment_ID();

    The comment_author and user_login fields are blank and are not being filled with information.

    This is how I try to catch these informations:
    comment_author

    $commentauthor = get_comment_author();
    $commentauthor = $_POST['comment_author'];

    user_login

    global $current_user;
    get_currentuserinfo();
    $current_user = $current_user->user_login;
    $current_user = $_POST['userlogin'];

    This is the insert query.

    $wpdb->query("INSERT INTO 1111_voting (comment_ID, comment_author, user_login) VALUES ($commentid, '$commentauthor', '$userlogin')");

    Thank you in advance for problem-solving.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help me with inserting info into Databse’ is closed to new replies.
Skip to toolbar