yunusbbayram
Öğrenci
- Katılım
- 5 Nisan 2012
- Mesajlar
- 1
- Reaksiyon puanı
- 0
- Puanları
- 0
Her makalede gözüken bir puanlama sistemi yaptım bilgisayarımda localhostta calışıyor ineternette çalışmıyor. hata şu sekilde cıkıyor.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/***/public_html/puanlama/oyal.php on line 50
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/***/public_html/puanlama/oyal.php on line 52
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/***/public_html/puanlama/oyal.php on line 68
Ortalama Puan : 0.00 | Katilan Kisi : | Toplam Puan : 0
makale.php dosyasının dışında oyal.php oyver.php adında ikidosya dan bir takım codlara ulaşılıyor. oyal.php nin içi şu sekilde.
cok uğraştım bulamadım acaba hata nerede?
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/***/public_html/puanlama/oyal.php on line 50
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/***/public_html/puanlama/oyal.php on line 52
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/***/public_html/puanlama/oyal.php on line 68
makale.php dosyasının dışında oyal.php oyver.php adında ikidosya dan bir takım codlara ulaşılıyor. oyal.php nin içi şu sekilde.
PHP:
<?php require_once('../connections/connection.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
//include ('connections/baglan.php');
mysql_select_db ($databese_connection, $connection);
/* mysql_select_db($database_connection, $connection);*/
$id = $_POST['MakaleID'];
$ip = getenv("REMOTE_ADDR");
$sql = "SELECT * FROM puanlar WHERE yazi = '" . $id . "'";
$sorgu = mysql_query($sql);
$say = mysql_num_rows($sorgu);
$puan = 0;
while($sonuc = mysql_fetch_array($sorgu)) {
$puan += $sonuc['puan'];
}
$Puan= $puan;
$ort = @($puan / $say);
$ortalama1 = sprintf(".2f", $ort);
$ortalama2 = round($ort);
$bos2 = 10 - $ortalama2;
$sql_ = "SELECT * FROM puanlar ";
$sql_ .= "WHERE yazi = '" . $id . "' AND veren = '" . $ip . "'";
$sorgu_ = mysql_query($sql_);
$say_ = mysql_num_rows($sorgu_);
if($say_ == 1) {
$puan_ = mysql_result($sorgu_, 0, "puan");
$bos_ = 10 - $puan_;
for($i = 1; $i <= $puan_; $i++) {
echo "<img src=\"puanlama/resimler/yesil.gif\" />";
}
for($j = 1; $j <= $bos_; $j++) {
echo "<img src=\"puanlama/resimler/gri.gif\" />";
}
} else {
for($i = 1; $i <= $ortalama2; $i++) {
echo "<img class=\"yildiz\" id=\"r" . $i;
echo "\" src=\"puanlama/resimler/sari.gif\" onmouseover=\"omo(" . $i;
echo ");\" onmouseout=\"omout();\" onclick=\"oc(" . $i;
echo ");\" />";
}
for($j = 1; $j <= $bos2; $j++) {
echo "<img class=\"yildiz\" id=\"r" . ($ortalama2 + $j);
echo "\" src=\"puanlama/resimler/gri.gif\" onmouseover=\"omo(";
echo ($ortalama2 + $j) . ");\" onmouseout=\"omout();\" ";
echo "onclick= \"oc(" . ($ortalama2 + $j) . ");\" />";
}
}
echo " Ortalama Puan : <b>" . $ortalama1;
echo "</b> | Katilan Kisi : <b>" . $say . "</b>";
echo " | Toplam Puan : <b>" . $Puan. "</b> ";
?>
cok uğraştım bulamadım acaba hata nerede?