-
-
Save CharlesCraft50/c6be67fd136388d7c15375a5cf2e0d9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if($PostUpVotes = $conn->prepare("SELECT * FROM PostVotes WHERE SubjectName = ? AND VoteType = 'UpVoted'")) { | |
$PostUpVotes->bind_param('s', $SubjectNamePost); | |
$PostUpVotes->execute(); | |
$PostUpVotes->store_result(); | |
$postUpVResult = $PostUpVotes->num_rows(); | |
echo "<script>$(\"#UpVoteThis\").html(\"" . "<img src=\\\"UpVoted-Icon.png\\\" width=\\\"30\\\" height=\\\"30\\\"></img> " . $postUpVResult . "" . "\");</script>"; | |
} else { | |
echo "<pre>Error UpVoting, Error: " . $conn->error . "</pre>"; | |
} | |
if($PostDownVotes = $conn->prepare("SELECT * FROM PostVotes WHERE SubjectName = ? AND VoteType = 'DownVoted'")) { | |
$PostDownVotes->bind_param('s', $SubjectNamePost); | |
$PostDownVotes->execute(); | |
$PostDownVotes->store_result(); | |
$postDownVResult = $PostDownVotes->num_rows(); | |
echo "<script>$(\"#DownVoteThis\").html(\"" . "<img src=\\\"DownVoted-Icon.png\\\" width=\\\"30\\\" height=\\\"30\\\"></img> " . $postDownVResult . "" . "\");</script>"; | |
} else { | |
echo "<pre>Error DownVoting, Error: " . $conn->error . "</pre>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment