| | |
Phpauction - View feedback error
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Mar 2005
Posts: 21
Reputation:
Solved Threads: 0
Hi,
I don't know if this is the right forum to post this, if not please move it or just delete it.
I installed Phpauction via Fantastico after trying several purchased scripts that just wouldn't work.
Everything is working fine except the "View Feedback" links which give the following error messages:
The feedback is still displayed, I just get these warnings at the top of the screen. I couldn't see any obvious errors in yourfeedback.php but then I'm not much good at PHP code.
I tried removing the entries at the end of the file for calling templates, but that really sent it nuts.
Here is the file. I would greatly appreciate it if anyone could "spot the obvious error" for me:
Thanks in advance,
Graham
I don't know if this is the right forum to post this, if not please move it or just delete it.
I installed Phpauction via Fantastico after trying several purchased scripts that just wouldn't work.
Everything is working fine except the "View Feedback" links which give the following error messages:
MySQL Syntax (Toggle Plain Text)
Warning: mysql_fetch_array(): supplied argument IS NOT a valid MySQL result resource IN /home/ozwww04/public_html/auction/yourfeedback.php on line 65 Warning: Cannot modify header information - headers already sent BY (output started at /home/ozwww04/public_html/auction/yourfeedback.php:65) IN /home/ozwww04/public_html/auction/includes/stats.inc.php on line 79 Warning: Cannot modify header information - headers already sent BY (output started at /home/ozwww04/public_html/auction/yourfeedback.php:65) IN /home/ozwww04/public_html/auction/themes/DEFAULT/header.php.html on line 1
The feedback is still displayed, I just get these warnings at the top of the screen. I couldn't see any obvious errors in yourfeedback.php but then I'm not much good at PHP code.
I tried removing the entries at the end of the file for calling templates, but that really sent it nuts.
Here is the file. I would greatly appreciate it if anyone could "spot the obvious error" for me:
MySQL Syntax (Toggle Plain Text)
<?#//v.3.2.2 #/////////////////////////////////////////////////////// #// COPYRIGHT 2007 Phpauction.org ALL RIGHTS RESERVED // #/////////////////////////////////////////////////////// include "./includes/config.inc.php"; include $include_path."dates.inc.php"; include $include_path."membertypes.inc.php"; foreach($membertypes as $idm => $memtypearr) { $memtypesarr[$memtypearr['feedbacks']]=$memtypearr; } ksort($memtypesarr,SORT_NUMERIC); if (($_SERVER["REQUEST_METHOD"]=="GET" || !$_SERVER["REQUEST_METHOD"])) { $secid = $_SESSION['PHPAUCTION_LOGGED_IN']; $TPL_rater_nick=$_SESSION['PHPAUCTION_LOGGED_IN_USERNAME']; $sql="SELECT nick, rate_sum, rate_num FROM PHPAUCTIONXL_users WHERE id=".intval($secid); $res=mysql_query ($sql); if ($res) { if (mysql_num_rows($res)>0) { $arr=mysql_fetch_array ($res); $TPL_nick=$arr['nick']; $i=0; foreach ($memtypesarr as $k=>$l) { if($k >= $arr['rate_sum'] || $i++==(count($memtypesarr)-1)) { $TPL_rate_ratio_value="<img src=\"./images/icons/".$l['icon']."\" alt=\"".$l['icon']."\" />"; break; } } $TPL_feedbacks_num=$arr['rate_num']; $TPL_feedbacks_sum=$arr['rate_sum']; } ELSE { $TPL_err=1; $TPL_errmsg="$ERR_105"; } } ELSE { $TPL_err=1; $TPL_errmsg="$ERR_106"; } if ($_GET[pg]==0) $pg = 1; $lines = (INT)$lines; if ($lines==0) $lines = 5; $left_limit = ($_GET[pg]-1)*$lines; $rsl = mysql_query ( "SELECT count(*) FROM PHPAUCTIONXL_feedbacks WHERE rated_user_id=".intval($secid)); if ($rsl) { $hash = mysql_fetch_array($rsl); $total = (INT)$hash[0]; } ELSE $total = 0; $TPL_feedbacks_num=$total; /* get number of pages */ $pages = CEIL($total/$lines); $sql="SELECT f.*,a.title FROM PHPAUCTIONXL_feedbacks f LEFT OUTER JOIN PHPAUCTIONXL_auctions a ON a.id=f.auction_id WHERE rated_user_id='$secid' ORDER by feedbackdate DESC LIMIT $left_limit,$lines"; $res=mysql_query ($sql); $i=0; $feed_disp=array(); while ($arrfeed = mysql_fetch_array($res)) { $feed_disp[$i]["username"]=$arrfeed['rater_user_nick']; $feed_disp[$i]["auctionurl"]=(($arrfeed['title']) ? "<a href='item.php?id=".$arrfeed['auction_id']."'>".$arrfeed['title']."</a>":$MSG_113.$arrfeed['auction_id']); $feed_disp[$i]["feedback"]=nl2br(stripslashes($arrfeed['feedback'])); $feed_disp[$i]["rate"]=$arrfeed['rate']; $feed_disp[$i]["feedbackdate"] = FormatDate($arrfeed['feedbackdate']); $sql="SELECT id,rate_num,rate_sum FROM PHPAUCTIONXL_users WHERE nick='".$feed_disp[$i]["username"]."'"; $usarr=mysql_fetch_array(mysql_query ($sql)); $feed_disp[$i]['usfeed']=$usarr['rate_sum']; $feed_disp[$i]['usflink']="profile.php?user_id=".$usarr['id']."&auction_id=".$arrfeed['auction_id']; $j=0; foreach ($memtypesarr as $k=>$l) { if($k >= $usarr['rate_sum'] || $j++==(count($memtypesarr)-1)) { $feed_disp[$i]['usicon']="<img src=\"./images/icons/".$l['icon']."\" alt=\"".$l['icon']."\" />"; break; } } switch($feed_disp[$i]['rate']) { CASE 1 : $feed_disp[$i]['img']="./images/positive.gif"; break; CASE -1: $feed_disp[$i]['img']="./images/negative.gif"; $sql="SELECT * FROM PHPAUCTIONXL_feedforum WHERE feed_id=".$arrfeed['id']." ORDER BY seqnum ASC"; $res_=@mysql_query ($sql); if($res_ && mysql_num_rows($res_)>0) { while($feedfor=mysql_fetch_array($res_)) { $feedfor["commentdate"] = FormatDate($feedfor['commentdate']); $feedfor['username']=($feedfor['user_id']==$secid) ? $TPL_nick : $arrfeed['rater_user_nick']; $feedfor['comment']=nl2br(strip_tags(stripslashes(($feedfor['comment'])))); $feed_disp[$i]['feedforum'][$feedfor['seqnum']]=$feedfor; } $nextfeedlink=END($feed_disp[$i]['feedforum']); if((($_SESSION['PHPAUCTION_LOGGED_IN']==$arrfeed['rated_user_id'] && $nextfeedlink['user_id']==$usarr['id']) || ($_SESSION['PHPAUCTION_LOGGED_IN']==$usarr['id'] && $nextfeedlink['user_id']==$arrfeed['rated_user_id'])) && $nextfeedlink['seqnum']<2) $feed_disp[$i]['nextfeedforum']="<a href='addfeedforum.php?feed_id=".$nextfeedlink['feed_id']."&seqnum=".$nextfeedlink['seqnum']."'>".$MSG_25_0201."</a>"; ELSE $feed_disp[$i]['nextfeedforum']=""; } ELSE { if($_SESSION['PHPAUCTION_LOGGED_IN']==$arrfeed['rated_user_id']) $feed_disp[$i]['nextfeedforum']="<a href='addfeedforum.php?feed_id=".$arrfeed['id']."&seqnum=0'>".$MSG_25_0201."</a>"; ELSE $feed_disp[$i]['nextfeedforum']=""; } break; CASE 0 : $feed_disp[$i]['img']="./images/neutral.gif"; break; } $i++; } $echofeed=""; for ($ind2=1; $ind2<=$pages; $ind2++) { if ($_GET[pg]!=$ind2) { $echofeed .="<a href=\"yourfeedback.php?pg=$ind2\"> $ind2</a>"; if($ind2 != $pages) { $echofeed .= " | "; } } ELSE { $echofeed .="$ind2"; if($ind2 != $pages){ $echofeed .= " | "; } } } $echofeed.=""; } // Calls the appropriate templates include "header.php"; include phpa_include("template_yourfeedback_php.html"); include "footer.php"; ?>
Thanks in advance,
Graham
The 1st warning, is because of this query.
Right after this query, you have
•
•
•
•
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ozwww04/public_html/auction/yourfeedback.php on line 65
mysql Syntax (Toggle Plain Text)
SELECT f.*,a.title FROM PHPAUCTIONXL_feedbacks f LEFT OUTER JOIN PHPAUCTIONXL_auctions a ON a.id=f.auction_id WHERE rated_user_id='$secid' ORDER BY feedbackdate DESC LIMIT $left_limit,$lines
$res=mysql_query ($sql); Instead, use $res=mysql_query ($sql) or die (mysql_error()); You will see why you are getting the warning. Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Mar 2005
Posts: 21
Reputation:
Solved Threads: 0
Thanks Nav33n,
I tired that and now I just get a blank screen with the error message:
Don't know if that helps. Means nothing to me
2am now. Better turn this machine off.
Graham
I tired that and now I just get a blank screen with the error message:
MySQL Syntax (Toggle Plain Text)
You have an error IN your SQL syntax; CHECK the manual that corresponds to your MySQL server version for the RIGHT syntax to USE near '-5,5' at line 6
Don't know if that helps. Means nothing to me
2am now. Better turn this machine off.
Graham
Hmm.. Well, Thats because the limits are not being set properly.
This block of code is the one causing you the problem.
If you are in page1, $_GET['pg'] will not be set (ie., it will be null and not 0). I can't guarantee you that this will work, but you can try this.
Cheers,
Naveen
php Syntax (Toggle Plain Text)
if ($_GET[pg]==0) $pg = 1; $lines = (int)$lines; if ($lines==0) $lines = 5; $left_limit = ($_GET[pg]-1)*$lines;
If you are in page1, $_GET['pg'] will not be set (ie., it will be null and not 0). I can't guarantee you that this will work, but you can try this. php Syntax (Toggle Plain Text)
if ($_GET['pg']=="" || $_GET['pg']==0){ $pg = 1; } else { $pg = $_GET['pg']; } $lines = (int)$lines; if ($lines==0) { $lines = 5; } $left_limit = ($pg-1)*$lines;
Cheers,Naveen
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Mar 2005
Posts: 21
Reputation:
Solved Threads: 0
Hi Naveen,
Thanks - that fixed it!
I have been making websites for seven years and usually manage to fumble my way through PHP mods by experimenting. This one was beyond me and I thought I might have SQL problems, which I won't even touch.
I appreciate your time and effort in looking at this for me.
I'm too old to learn any more new programming languages and sometimes think it's time to hang up my webmaster role. Things are just getting far too complicated for me now.
But your fix may help someone else in the future too, which is what is so good about Dani's forums.
Thanks again,
Graham
Thanks - that fixed it!
I have been making websites for seven years and usually manage to fumble my way through PHP mods by experimenting. This one was beyond me and I thought I might have SQL problems, which I won't even touch.
I appreciate your time and effort in looking at this for me.
I'm too old to learn any more new programming languages and sometimes think it's time to hang up my webmaster role. Things are just getting far too complicated for me now.
But your fix may help someone else in the future too, which is what is so good about Dani's forums.
Thanks again,
Graham
![]() |
Similar Threads
- Unmetered Web space for Reseller Web Hosting from WebHostingWith.us (Web Hosting Deals)
Other Threads in the MySQL Forum
- Previous Thread: INSERT columns into rows
- Next Thread: MYSQL User and Backup
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm data database design developer development distinct drupal dui ec2 email enter enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql syntax techsupport thunderbird transparency virtualization







