Hello,
I got two problems.. First is search.. It keeps giving me errors.. I am too tired right now to figure out what is wrong and he needs it tonight.
Here:
Should work..
Second one is rating.. It messes up the rating. Here
It keeps giving me like 40-303 variables which it shouldn't when I only vote 1.
If you can help I will give you some NP$..
iNod
I got two problems.. First is search.. It keeps giving me errors.. I am too tired right now to figure out what is wrong and he needs it tonight.
Here:
PHP:
$gettuts = mysql_query("SELECT * from tutorials WHERE name LIKE '$search%' ORDER BY id DESC LIMIT " . $page . ",10");
$numrows = mysql_num_rows($gettuts);
if($numrows=="0") {
$tut->set('search',$english_search_zero);
}else{
while($row = mysql_fetch_assoc($gettuts)) {
$tuts[] = $row;
}
Should work..
Second one is rating.. It messes up the rating. Here
PHP:
$ratesql = mysql_query("SELECT rating,num_votes FROM tutorials WHERE id='$tutid'");
$getrate = mysql_fetch_array($ratesql);
if(session_is_registered("rating$tutid")) {
header("location: view_tutorials.php?tutid=" . $tutid . "&catid=" . $catid . "&rate=1");
exit;
}else{
$rate = $getrate['rating'];
$rating = $_POST['rating'];
if($rate=="0") {
$new_rate = "$rating";
}else{
$num_votes = $getrate['num_votes'];
$num_votess = $getrate['num_votes']+1;
$new_rating = $rate * $rating;
$new_rating2 = $new_rating / $num_votes;
$new_rate = $new_rating2;
}
$updaterate = mysql_query("UPDATE tutorials SET rating='$new_rate',num_votes='$num_votess' WHERE id='$tutid'");
session_register("rating$tutid");
It keeps giving me like 40-303 variables which it shouldn't when I only vote 1.
If you can help I will give you some NP$..
iNod





