PHP Code:
$addplus = mysql_fetch_array(mysql_query("SELECT rate,total FROM gallery_files WHERE id='".$id."'"));
$addplus = $rate + $addplus[0];
$total = $addplus[1] + 10;
$res = mysql_query("UPDATE gallery_files SET rate= '".$addplus."', total = '".$total."' WHERE id='".$id."'");
if($res){
$main.="<p align=\"center\">";
$main.="<img src=\"../phpThumb/phpThumb.php?src=../images/ok.gif\" alt=\"O\"/>You Have Rated This Picture Successfully<br/>";
mysql_query("INSERT INTO rated SET id='".$id."', bywho='".getuid_sid($sid)."', value='".$rate."'");
}
Comment