Man i am getting a tumor over this. Ok this morning i noticed my game page was all messed up.
I moved my site to a new server banner less :) it was all ok last night but now hell.
So i re did the code and cleaned it up but now it dont work at all.
It selects the box art but thats it!
I know its sending the itemid because in the url it shows it.
item.php?itemid =2
[PHP]<?
$itemid = $_REQUEST['itemid'];
$sql = "select d.title, d.directions, d.gameinfo, d.hits, d.rating, d.userid, c.category, d.gamerating, d.publisher, d.genar, d.screenshots from items d, categories c where d.itemid = $itemid and c.categoryid = d.categoryid";
$result = mysql_query($sq l ,$db);
$pagetitle = $myrow["title"];
$directions = $myrow["directions "];
$gameinfo = $myrow["gameinfo"];
$hits = $myrow["hits"];
$itemrating = $myrow["rating"];
$userid = $myrow["userid"];
$category = $myrow["category"];
$gamerating = $myrow["gamerating "];
$publisher = $myrow["publisher"];
$genar = $myrow["genar"];
$screenshots = $myrow["screenshot s"];
$username = "Admin";
if ($userid != 0) {
$sql = "select login from users where userid = $userid";
$result = mysql_query($sq l ,$db);
$username = $myrow["login"];
}
$hits++;
$sql = "update items set hits = $hits where itemid = $itemid";
$result = mysql_query($sq l ,$db);
if ($ratevalue) {
$ratecount = 0;
$ratetotal = 0;
$ip = getenv(remote_a ddr);
$sql = "select * from ratings where itemid = $itemid and ip = '$ip'";
$result = mysql_query($sq l ,$db);
if ($myrow = mysql_fetch_arr ay($result)) {
$ratemsg = "<font color='#FF0000' size='1'>Error: </font> <font size='1'>You have already rated this item</font>";
} else {
$sql = "insert into ratings (itemid, rating, ip) values ($itemid, $ratevalue, '$ip')";
$result2 = mysql_query($sq l ,$db);
$sql = "select rating from ratings where itemid = $itemid";
$result3 = mysql_query($sq l ,$db);
if ($myrow2 = mysql_fetch_arr ay($result3)) {
do {
$ratetotal = $ratetotal + $myrow2["rating"];
$ratecount++;
}
while ($myrow2 = mysql_fetch_arr ay($result3)); {
}
}
$newrate = $ratetotal / $ratecount;
$sql = "update items set rating = $newrate where itemid = $itemid";
$result4 = mysql_query($sq l ,$db);
$ratemsg = "<font size='1'>Thank you for rating this $itemlower</font>";
}
$itemrating = $newrate;
}
?>[/PHP]
I moved my site to a new server banner less :) it was all ok last night but now hell.
So i re did the code and cleaned it up but now it dont work at all.
It selects the box art but thats it!
I know its sending the itemid because in the url it shows it.
item.php?itemid =2
[PHP]<?
$itemid = $_REQUEST['itemid'];
$sql = "select d.title, d.directions, d.gameinfo, d.hits, d.rating, d.userid, c.category, d.gamerating, d.publisher, d.genar, d.screenshots from items d, categories c where d.itemid = $itemid and c.categoryid = d.categoryid";
$result = mysql_query($sq l ,$db);
$pagetitle = $myrow["title"];
$directions = $myrow["directions "];
$gameinfo = $myrow["gameinfo"];
$hits = $myrow["hits"];
$itemrating = $myrow["rating"];
$userid = $myrow["userid"];
$category = $myrow["category"];
$gamerating = $myrow["gamerating "];
$publisher = $myrow["publisher"];
$genar = $myrow["genar"];
$screenshots = $myrow["screenshot s"];
$username = "Admin";
if ($userid != 0) {
$sql = "select login from users where userid = $userid";
$result = mysql_query($sq l ,$db);
$username = $myrow["login"];
}
$hits++;
$sql = "update items set hits = $hits where itemid = $itemid";
$result = mysql_query($sq l ,$db);
if ($ratevalue) {
$ratecount = 0;
$ratetotal = 0;
$ip = getenv(remote_a ddr);
$sql = "select * from ratings where itemid = $itemid and ip = '$ip'";
$result = mysql_query($sq l ,$db);
if ($myrow = mysql_fetch_arr ay($result)) {
$ratemsg = "<font color='#FF0000' size='1'>Error: </font> <font size='1'>You have already rated this item</font>";
} else {
$sql = "insert into ratings (itemid, rating, ip) values ($itemid, $ratevalue, '$ip')";
$result2 = mysql_query($sq l ,$db);
$sql = "select rating from ratings where itemid = $itemid";
$result3 = mysql_query($sq l ,$db);
if ($myrow2 = mysql_fetch_arr ay($result3)) {
do {
$ratetotal = $ratetotal + $myrow2["rating"];
$ratecount++;
}
while ($myrow2 = mysql_fetch_arr ay($result3)); {
}
}
$newrate = $ratetotal / $ratecount;
$sql = "update items set rating = $newrate where itemid = $itemid";
$result4 = mysql_query($sq l ,$db);
$ratemsg = "<font size='1'>Thank you for rating this $itemlower</font>";
}
$itemrating = $newrate;
}
?>[/PHP]
Comment