我不在乎,选择*从不工作。 [英] I am going out of my mind, select * from not working.
问题描述
男人,我得了肿瘤。好的,今天早上我注意到我的游戏页面都搞砸了。
我把我的网站搬到了一个新的服务器横幅更少:)昨晚一切都好,但现在很糟糕。
>
所以我做了代码并清理了它,但现在它根本不工作。
它选择盒子艺术,但就是这样!
我知道它发送itemid是因为它在url中显示它。
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其中d.itemid = $ itemid和c.categoryid = d.categoryid" ;
$ result = mysql_query($ sql,$ db);
$ pagetitle = $ myrow [" title"];
$ directions = $ myrow [" directions"];
$ gameinfo = $ myrow [" gameinfo"];
$ hits = $ myrow [" ;命中"];
$ itemrating = $ myrow [" rating"];
$ userid = $ myrow [" userid"];
$ category = $ myrow [" category"];
$ gamerating = $ myrow [" gamerating"];
$ publisher = $ myrow [" ;发布商"];
$ genar = $ myrow [" genar"];
$ screenshots = $ myrow [" screenshots"];
$ username =" Admin";
if($ userid!= 0){
$ sql ="选择用户登录,其中userid = $ userid" ;;
$ result = mysql_query($ sql,$ db);
$ username = $ myrow [" login"];
}
$ hits ++;
$ sql =" update items set hits = $ hits where itemid = $ itemid" ;;
$ result = mysql_query($ sql,$ db);
if($ ratevalue){
$ ratecount = 0;
$ ratetotal = 0;
$ ip = getenv(remote_addr);
$ sql =" select * from ratings where itemid = $ itemid and ip =''$ ip''" ;;
$ result = mysql_query($ sql,$ db);
if($ myrow = mysql_fetch_array($ result)){
$ ratemsg ="< font color =''#FF0000''size =''1''>错误:< ; /字体> < font size =''1''>您已对此商品评分< / font>" ;;
}其他{
$ sql =" insert进入评级(itemid,rating,ip)值($ itemid,$ ratevalue,''$ ip'')" ;;
$ result2 = mysql_query($ sql,$ db);
$ sql ="从评级中选择评级,其中itemid = $ itemid" ;;
$ result3 = mysql_query($ sql,$ db);
if($ myrow2 = mysql_fetch_array($ result3)){
do {
$ ratetotal = $ ratetotal + $ myrow2 [" rating"];
$ ratecount ++;
}
while($ myrow2 = mysql_fetch_array($ result3)); {$ / $
}
}
$ newrate = $ ratetotal / $ ratecount;
$ sql ="更新项目设置评级= $ newrate where itemid = $ itemid" ;;
$ result4 = mysql_query($ sql,$ db);
$ ratemsg ="< font size =''1''>感谢您对此$ itemlower< / font>" ;;
进行评分
}
$ itemrating = $ newrate;
}
?> ; [/ PHP]
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($sql ,$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["screenshots"];
$username = "Admin";
if ($userid != 0) {
$sql = "select login from users where userid = $userid";
$result = mysql_query($sql ,$db);
$username = $myrow["login"];
}
$hits++;
$sql = "update items set hits = $hits where itemid = $itemid";
$result = mysql_query($sql ,$db);
if ($ratevalue) {
$ratecount = 0;
$ratetotal = 0;
$ip = getenv(remote_addr);
$sql = "select * from ratings where itemid = $itemid and ip = ''$ip''";
$result = mysql_query($sql ,$db);
if ($myrow = mysql_fetch_array($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($sql ,$db);
$sql = "select rating from ratings where itemid = $itemid";
$result3 = mysql_query($sql ,$db);
if ($myrow2 = mysql_fetch_array($result3)) {
do {
$ratetotal = $ratetotal + $myrow2["rating"];
$ratecount++;
}
while ($myrow2 = mysql_fetch_array($result3)); {
}
}
$newrate = $ratetotal / $ratecount;
$sql = "update items set rating = $newrate where itemid = $itemid";
$result4 = mysql_query($sql ,$db);
$ratemsg = "<font size=''1''>Thank you for rating this $itemlower</font>";
}
$itemrating = $newrate;
}
?>[/PHP]
推荐答案
itemid =
_REQUEST [''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。截面来自项目d,类别c,其中d.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 =
这篇关于我不在乎,选择*从不工作。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!