Hi everyone
i need a small help over here
i have a plugin which i have edited
but i am not able to get a small if else condition, i dont know what condition to give
i have written the following code
Code:
$C=$wpdb->query("SELECT comment_author_email FROM wp_comments");
now what i want is if a person comes and post comment on my post(he will put his email ID) if he is new to comment then run a query else nothing
In this what i actually require is if that email ID(which he inputs before commenting) is present in comment_author_email then do nothing, else if he is new(email ID is new) then run that query
i tried this, but seems to be wrong
Code:
$C=$wpdb->query("SELECT comment_author_email FROM wp_comments");
if($C>1){
$wpdb->query("INSERT INTO `".$wpdb->myrp_ratings."`(ID, category_id, post_id, comment_id, value, outof, weighted) VALUES('', '{$rc}', '{$post_id}', '{$commentID}', '" . $value . "', '{$outof}', '" . ($value/$outof) . "');");
}
how can i fix this if else condition?
i know it is wrong
|