Author Topic: error when trying to view recipes  (Read 54 times)

Offline jimbo51

  • Sr. Member
  • ****
  • Posts: 5
  • Karma: +0/-0
error when trying to view recipes
« on: September 09, 2017, 10:00:44 AM »
Hi im runing Mar par recipe script ver 3,1 but i am unable to view  the recipes i get this at top of page Incorrect usage of UNION and LIMIT
Incorrect usage of UNION and LIMIT

anyone advise please

www.recipesrus.co.uk

Offline alexa

  • Administrator
  • Hero Member
  • *****
  • Posts: 449
  • Karma: +7/-1
Re: error when trying to view recipes
« Reply #1 on: September 09, 2017, 02:06:35 PM »
Hello,

In recipe.php replace this code:

Code: [Select]
$brecordSet = $conn->Execute('SELECT * FROM recipes WHERE univer = '.$conn->qstr($name).' and main = '.$conn->qstr('1').' LIMIT 1 UNION SELECT * FROM recipes WHERE MATCH (recipname,shortdesc) AGAINST ('.$conn->qstr($title).' IN BOOLEAN MODE) and main = '.$conn->qstr('1').' LIMIT 8');

with this code:

Code: [Select]
$brecordSet = $conn->Execute('(SELECT * FROM recipes WHERE univer = '.$conn->qstr($name).' and main = '.$conn->qstr('1').' LIMIT 1) UNION (SELECT * FROM recipes WHERE MATCH (recipname,shortdesc) AGAINST ('.$conn->qstr($title).' IN BOOLEAN MODE) and main = '.$conn->qstr('1').' LIMIT 8)');

Offline jimbo51

  • Sr. Member
  • ****
  • Posts: 5
  • Karma: +0/-0
Re: error when trying to view recipes
« Reply #2 on: September 09, 2017, 03:10:19 PM »
Thank you now back up and running :)