Note that there are some explanatory texts on larger screens.

plurals
  1. POUnsupported operand type?
    text
    copied!<p>I've got to say I am completely clueless in terms of PHP, I know enough to moderate my sites to an acceptable extent. I'm having a bit of trouble with phpauction GPL, whenever I click on one of my categories, I get this: </p> <p>Fatal error: Unsupported operand types in /home/retrorea/public_html/tradepost/browse.php on line 175</p> <p>This is what line 175 reads...</p> <pre><code>$left_limit = ($page-1)*$lines; </code></pre> <p>Here's the rest of the code.</p> <pre><code>&lt;?#//v.3.2.3 #/////////////////////////////////////////////////////// #// COPYRIGHT 2007 Phpauction.net ALL RIGHTS RESERVED // #/////////////////////////////////////////////////////// require('./includes/config.inc.php'); include $include_path."auctionstoshow.inc.php"; #// Get parameters from the URL $params = getUrlParams("="); if(empty($_GET['id'])) $_GET['id'] = $params['id']; else $params['id'] = $_GET['id']; $id = intval($params['id']); #// ############################################################################# function getsubtree($catsubtree,$i) { global $catlist; $res=mysql_query("SELECT cat_id FROM PHPAUCTIONXL_categories WHERE parent_id=".intval($catsubtree[$i])); while($row=mysql_fetch_assoc($res)) { $catlist[]=$row['cat_id']; $catsubtree[$i+1]=$row['cat_id']; getsubtree($catsubtree,$i+1); } } $catsubtree[0]=$id; $catlist[]=$catsubtree[0]; getsubtree($catsubtree,0); $catalist="("; $catalist.=join(",",$catlist); $catalist.=")"; $NOW = date("YmdHis",mktime(date("H")+$SETTINGS['timecorrection'],date("i"),date("s"),date("m"), date("d"),date("Y"))); if ($id==0) { /* display full list of categories of level 0 */ $result = mysql_query ( "SELECT * FROM PHPAUCTIONXL_categories WHERE parent_id='0' ORDER BY cat_name" ); if (!$result) { /* output error message and exit */ print "database error"; exit; } else { /* query succeeded - display list of categories */ $need_to_continue = 1; $cycle = 1; $TPL_main_value = ""; $TPL_categories_string = $MGS_2__0027; while ($row=mysql_fetch_array($result)) { if ($cycle==1 ) { $TPL_main_value.="&lt;tr WIDTH=100% ALIGN=LEFT&gt;\n"; } $sub_counter = (int)$row['sub_counter']; $cat_counter = (int)$row['counter']; if ($sub_counter!=0) $count_string = "(".$sub_counter.")"; else { $count_string = ""; } #// Retrieve the translated category name $row['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM PHPAUCTIONXL_cats_translated WHERE cat_id=".$row['cat_id']." AND lang='".$language."'"),0,"cat_name"); $TPL_main_value .=!empty($row['cat_colour']) ? " &lt;td BGCOLOR=\"".$row['cat_colour']."\" WIDTH=\"33%\"&gt;&lt;a href=\"".$SETTINGS['siteurl']."browse.php?id=".$row['cat_id']."\"&gt;".$row['cat_name'].$count_string."&lt;/a&gt;&lt;/td&gt;\n" : " &lt;td WIDTH=\"33%\"&gt;&lt;a href=\"".$SETTINGS['siteurl']."browse.php?id=".$row['cat_id']."\"&gt;".$row['cat_name'].$count_string."&lt;/a&gt;&lt;/td&gt;\n"; ++$cycle; if ($cycle==4) { $cycle=1; $TPL_main_value.="&lt;/tr&gt;\n"; } } if ( $cycle&gt;=2 &amp;&amp; $cycle&lt;=3 ) { while ( $cycle&lt;4 ) { $TPL_main_value .= " &lt;td WIDTH=\"33%\"&gt;&amp;nbsp;&lt;/td&gt;\n"; ++$cycle; } $TPL_main_value .= "&lt;/tr&gt;\n"; } $TPL_auctions_list_value = array(); $PAGE = 1; $PAGES = 1; include "header.php"; include phpa_include("template_browse_header_php.html"); include phpa_include("template_browse_php.html"); include "footer.php"; exit; } } else { /* specified category number look into table - and if we don't have such category - redirect to full list */ $result = mysql_query ( "SELECT * FROM PHPAUCTIONXL_categories WHERE cat_id=".intval($id) ); if ($result) $category = mysql_fetch_array($result); else $category = false; #// Retrieve the translated category name $category['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM PHPAUCTIONXL_cats_translated WHERE cat_id=".$category['cat_id']." AND lang='".$language."'"),0,"cat_name"); if (!$category) { /* redirect to global categories list */ header ( "Location: browse.php?id=0" ); exit; } else { /* such category exists retrieve it's subcategories and its auctions */ /* recursively get "path" to this category */ $TPL_categories_string = "".$category["cat_name"]; $par_id = (int)$category['parent_id']; while ( $par_id!=0 ) { // get next parent $res = mysql_query ( "SELECT * FROM PHPAUCTIONXL_categories WHERE cat_id=".intval($par_id)); if ($res) { $rw = mysql_fetch_array($res); if ($rw) $par_id = (int)$rw['parent_id']; else $par_id = 0; } else $par_id = 0; #// Retrieve the translated category name $rw['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM PHPAUCTIONXL_cats_translated WHERE cat_id=".$rw['cat_id']." AND lang='".$language."'"),0,"cat_name"); $TPL_categories_string = "&lt;a href=\"".$SETTINGS['siteurl']."browse.php?id=".$rw["cat_id"]."\"&gt;".$rw["cat_name"]."&lt;/a&gt; &amp;gt; ".$TPL_categories_string; } /* get list of subcategories of this category */ $subcat_count = 0; $result = mysql_query ( "SELECT * FROM PHPAUCTIONXL_categories WHERE parent_id=".intval($id)." ORDER BY cat_name" ); if (!$result) { /* output error message and exit */ } else { /* query succeeded - display list of categories */ $need_to_continue = 1; $cycle = 1; $TPL_main_value = ""; while ($row=mysql_fetch_array($result)) { ++$subcat_count; if ($cycle==1 ) { $TPL_main_value.="&lt;tr ALIGN=LEFT&gt;\n"; } $sub_counter = (int)$row['sub_counter']; $cat_counter = (int)$row['counter']; if ($sub_counter!=0) $count_string = "(".$sub_counter.")"; else { if ($cat_counter!=0) { $count_string = "(".$cat_counter.")"; } else $count_string = ""; } if($row['cat_colour'] != "") { $BG ="BGCOLOR=".$row['cat_colour']; } else { $BG = ""; } #// Retrieve the translated category name $row['cat_name'] = @mysql_result(mysql_query("SELECT cat_name FROM PHPAUCTIONXL_cats_translated WHERE cat_id=".$row['cat_id']." AND lang='".$language."'"),0,"cat_name"); $TPL_main_value .= " &lt;td $BG WIDTH=\"33%\"&gt;&lt;a href=\"".$SETTINGS['siteurl']."browse.php?id=".$row['cat_id']."\"&gt;".$row['cat_name'].$count_string."&lt;/a&gt;&lt;/td&gt;\n"; ++$cycle; if ($cycle==4) { $cycle=1; $TPL_main_value.="&lt;/tr&gt;\n"; } } if ( $cycle&gt;=2 &amp;&amp; $cycle&lt;=3 ) { while ( $cycle&lt;4 ) { $TPL_main_value .= " &lt;td WIDTH=\"33%\"&gt;&amp;nbsp;&lt;/td&gt;\n"; ++$cycle; } $TPL_main_value .= "&lt;/tr&gt;\n"; } } /* determine limits for SQL query */ $left_limit = ($page-1)*$lines; /* retrieve records corresponding to passed page number */ $page = (int)$page; if ($page==0) $page = 1; $lines = (int)$lines; if ($lines==0) $lines = 50; /* get total number of records */ $qs = "SELECT count(*) FROM PHPAUCTIONXL_auctions WHERE category IN $catalist AND starts&lt;=".$NOW." AND closed='0' AND private='n' AND suspended ='0'"; if($SETTINGS['adultonly']=='y' &amp;&amp; !isset($_SESSION["PHPAUCTION_LOGGED_IN"])){ $qs .= "AND adultonly='n'"; } if(!empty($_POST['catkeyword'])){ $qs .= " AND title like '%".addslashes($_POST['catkeyword'])."'%"; } $rsl = mysql_query ($qs); if ($rsl) { $hash = mysql_fetch_array($rsl); $total = !$hash[0] ? 1 : (int)$hash[0]; } else $total = 1; #// Handle pagination $TOTALAUCTIONS = $total; if(!isset($_GET["PAGE"]) || $_GET["PAGE"] == 1) { $OFFSET = 0; $PAGE = 1; } else { $PAGE = $_REQUEST["PAGE"]; $OFFSET = ($PAGE - 1) * $LIMIT; } $PAGES = ceil($TOTALAUCTIONS / $LIMIT); $qs = "SELECT * FROM PHPAUCTIONXL_auctions WHERE category IN $catalist AND starts&lt;=".$NOW." AND closed='0' AND private='n' AND suspended ='0' "; if($SETTINGS['adultonly']=='y' &amp;&amp; !isset($_SESSION["PHPAUCTION_LOGGED_IN"])){ $qs .= " AND adultonly='n'"; } if(!empty($_POST['catkeyword'])){ $qs .= " AND title like '%".addslashes($_POST['catkeyword'])."%' "; } $qs .= "ORDER BY ends ASC LIMIT ".intval($OFFSET).",".intval($LIMIT); $result = mysql_query ($qs); /* get list of auctions of this category */ $auctions_count = 0; /* selectd items formatter */ include $include_path."browseitems.inc.php"; $TPL_auctions_list_value=browseItems($result); $auctions_count=count($TPL_auctions_list_value); /*$TPL_auctions_total_value .= "&lt;br /&gt;". "$MSG_290 $total&lt;br /&gt;". "$MSG_289 $pages ($lines $MSG_291)&lt;br /&gt;". $MSG_25_0229; for ($i=1; $i&lt;=$pages; ++$i) { $TPL_auctions_total_value .= ($page==$i) ? " $i " : " &lt;a href=\"".$SETTINGS['siteurl']."browse.php?id=".$id."&amp;page=$i\"&gt;$i&lt;/a&gt; "; } */ $TPL_auctions_total_value .=""; if ($auctions_count==0) { $TPL_auctions_total_value = $ERR_114; } } include "header.php"; include phpa_include("template_browse_header_php.html"); if ( $subcat_count&gt;0 ) { include phpa_include("template_browse_php.html"); } if ($subcat_count==0) { include phpa_include("template_auctions_no_cat.html"); } include "footer.php"; } ?&gt; </code></pre> <p>Any help would be greatly appreciated. Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload