0

I find this code in stackoverflow, I have manage to fix it in the aim to add it to the database.

But the VoteRate, that shows the votes is not working.

Im using this code:

$db = new PDO('mysql:database=xxxxx;host=localhost', 'xxxxxxxx', 'xxxxxxxx');
$sth = $db->prepare("SELECT add_iP FROM PostsRating WHERE questions_id = :id");
$sth->execute(array(':id' => $_GET['id']));
$clicked = $pluswhite = $ratewhite = '';
    if ($sth->fetchColumn()) {
      $clicked = " clicked";
      $pluswhite = " PlusWhiteButton";
      $ratewhite = " RateCountWhiteButton";     
      }
<span class="up vote<?php echo $clicked; ?>" name="voteup" id="<?php $_GET['id']; ?>">
<span class="plus<?php echo $pluswhite; ?>">+</a>
<span class="rateCount<?php echo $ratewhite; ?>"><?php echo $VoteRate; ?></a>
</span>

I hope someone can help me with idees

w3spi
  • 4,380
  • 9
  • 47
  • 80
Niklas
  • 543
  • 2
  • 8
  • 17

0 Answers0