Jump to content

Recommended Posts

my new rating system is working ok here www.pokerdepositoptions.com/display.php?affid=1

 

For some reason the ratings are not showing properly in paypal-poker.php

 

it is showing 0star.jpg even if it has a rating

 

look here www.pokerdepositoptions.com/paypal-poker-deposit.php

 

 

 

// Displayrating.php

 

<?

include'connect.php';

$result1 = mysql_query("SELECT * FROM ratings WHERE (affid = '$affid')");

$num1 = mysql_num_rows($result1);

if ($num1 > 1){$txt = 'Ratings';}

else {$txt='Rating';}

$query2 = "SELECT AVG(rating) FROM ratings WHERE (affid = '$affid')";

 

$result2 = mysql_query($query2) or die(mysql_error());

 

// Print out result

while($row2 = mysql_fetch_array($result2)){

    $actualrating = $row2['AVG(rating)'];

$roundrating = round($actualrating);

$ratecode = "<img border='0' src='images/".$roundrating."star.jpg'> ".$num." ".$txt;

 

 

 

 

 

} ?>

 

paypal-poker.php

 

 

 

<?php

include"connect.php";

include"displayrating.php";

 

 

$result = mysql_query("SELECT * FROM affiliates WHERE paypal = '<li>paypal</li>' ORDER BY rank DESC")or die(mysql_error());

 

 

echo"<blockquote><p class='style10'>Paypal Poker Sites and casinos  </p></blockquote>";

echo"<table width='100%' border='1' bordercolor='#EAEAEA' align='center' cellspacing='0' cellpadding='0' bgcolor='white'> ";

echo"<tr ><td width='120'><center>Site</center></td>";

echo"<td><center>Link</center></td>";

echo"<td><center>Bonus</center></td>";

echo"<td><center>Bonuscode</center></td>";

echo"<td><center>Usa</center></td>";

echo"<td><center>Rank</center></td>";

echo"<td><center>Review</center></td>";

echo"</tr><tr><td>";

 

 

// keeps getting the next row until there are no more to get

while($row = mysql_fetch_array( $result )) {

$affid = $row['id'];

// Print out the contents of each row into a table

echo"</tr><tr><td>";

 

echo "<a href='";

echo $row['url'];

echo"'>";

echo"<center><img src='";

echo"$row[i120x120]' width='120' height='120' border='0' />";

echo"</a></center>";

echo"</td><td><center>";

echo"<a href='";

echo"$row";

echo"'>";

echo $row['site'];

echo"</a>";

 

 

echo"</center></td><td><center>";

echo"$row[bonus]";

echo"</center></td><td><center>";

echo"$row[bonuscode]";

echo"</center></td><td><center>";

echo"$row[usa]";

echo"</center></td><td><center>";

echo $ratecode;

echo"</center></td><td><center>";

echo"<a href='http://www.pokerdepositoptions.com/display.php?affid=";

echo"$row[id]";

echo" '>Read more</a></center></tr><tr>";

}

 

echo"</td><td></tr></table>";

 

?>

 

 

If anyone can help me it would be much appreciated !

Link to comment
https://forums.phpfreaks.com/topic/72490-solved-help/
Share on other sites

Quickly looking at your code, I found a problem that might just be throwing everything off.

 

In display.php, you have this code.

 

$actualrating = $row2['AVG(rating)'];

 

That isn't the correct way of doing that, you need to change your query to this:

$query2 = "SELECT AVG(rating) AS avg_rating FROM ratings WHERE affid = '$affid'"; 

 

Now, change the first line of code I posted to this

$actualrating = $row2['avg_rating'];

 

See if that changes anything before I look at the code any further.

Link to comment
https://forums.phpfreaks.com/topic/72490-solved-help/#findComment-365532
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.