Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 10-14-2010, 05:12 AM if else help
Banned

Posts: 408
Name: mushget
Trades: 0
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
mushget is offline
Reply With Quote
View Public Profile Visit mushget's homepage!
 
 
Register now for full access!
Reply     « Reply to if else help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.64599 seconds with 12 queries