View Single Post
  #62  
Old 08-02-2004, 01:07 PM
 
sarahnk sarahnk is offline
 

Advanced Member
  
Join Date: Jan 2004
Location: New York, NY
Posts: 58
 

Default

I'm trying to get this work on 4.0.1 but it gives me this error
  • INVALID SQL: 1064 : 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 'WHERE productid='19'' at line 1
    SQL QUERY FAILURE: SELECT COUNT(*) FROM WHERE productid='19'

I also changed this line:

Code:
$product_links = (func_query$search_query = "select DISTINCT $sql_tbl[products].*, $sql_tbl[categories].category, $sql_tbl[pricing].price from $sql_tbl[products], $sql_tbl[pricing], $sql_tbl[categories], $sql_tbl[product_links] where ($sql_tbl[pricing].membership='') and ($sql_tbl[pricing].productid=$sql_tbl[products].productid) and ($sql_tbl[pricing].quantity=1) and ($sql_tbl[products].categoryid=$sql_tbl[categories].categoryid) and $sql_tbl[products].forsale='Y' and ($sql_tbl[products].productid=$sql_tbl[product_links].productid2) and ($sql_tbl[product_links].productid1='$productid') ORDER BY $sql_tbl[products].product");


to this: (from 4.0.1 version)
Code:
$product_links = func_query("SELECT DISTINCT $sql_tbl[products].productid, $sql_tbl[products].product, $sql_tbl[products].productcode, MIN($sql_tbl[pricing].price) AS price FROM $sql_tbl[products], $sql_tbl[pricing], $sql_tbl[product_links] WHERE $sql_tbl[products].productid=$sql_tbl[product_links].productid2 AND $sql_tbl[product_links].productid1='$productid' AND $sql_tbl[pricing].productid=$sql_tbl[products].productid AND $sql_tbl[pricing].quantity=1 AND $sql_tbl[pricing].variantid = 0 AND ($sql_tbl[pricing].membership='$membership' OR $sql_tbl[pricing].membership='') AND $sql_tbl[products].forsale='Y' GROUP BY $sql_tbl[products].productid ORDER BY $sql_tbl[product_links].orderby, $sql_tbl[products].product");
__________________
3rd site: 4.1.0 (currently working on)

2nd site: Version 4.0.12

X-Cart version 3.5.14
PHP 4.3.3 details
MySQL server 4.0.15
Reply With Quote