(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:
$commentauthor = get_comment_author(); $commentauthor = $_POST['comment_author'];
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.