Hi Below is my query and it works with prepare keyword on the localhost but whenever I use prepare keyword with my queries on live server the data does not show up and as soon I remove prepare from query on live server the query works. So I did this to save my site from SQL injection. So if what is that I am doing wrong. Am I good and safe with prepare on live server because with prepare and my below syntax data shows empty always. Thanks people.
$sqll = "SELECT Sum(votes.votes) AS votessum FROM votes WHERE votes.uid = '$uid' && votes.competition = '$comp'"; $reel = $wpdb->get_var($wpdb->prepare($sqll)) or die(mysql_error()); echo json_encode ($reel); die();