summaryrefslogtreecommitdiff
path: root/food_search.php
diff options
context:
space:
mode:
Diffstat (limited to 'food_search.php')
-rw-r--r--food_search.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/food_search.php b/food_search.php
index 3466a00..4e92c74 100644
--- a/food_search.php
+++ b/food_search.php
@@ -115,13 +115,13 @@ if ( $_GET['sortType'] == "Food Description" ) {
# build the main query
$sql = sprintf ("
- SELECT foodDescs.ndb_no, foodDescs.popularity AS popularity, %s AS foodDesc,
+ SELECT foodDescs.ndb_no, foodDescs.popularity AS popularity,
+ CONCAT(foodDescs.long_desc, foodDescs.comname) AS foodDesc,
foodCats.fdgrp_cd, foodCats.fdgrp_desc
FROM foodDescs LEFT JOIN foodCats
ON foodDescs.fdgrp_cd = foodCats.fdgrp_cd
%s
",
- $db->_dbConn->Concat("foodDescs.long_desc", "', '", "foodDescs.comname"),
$where
);
@@ -137,7 +137,9 @@ $sql = sprintf ("
# having to parse it
$sql .= sprintf ("
UNION
- SELECT %s AS ndb_no, userFoods.popularity AS popularity, description AS foodDesc,
+ SELECT CONCAT('food=',userFoods.food,'&weight=',userFoods.weight,'&quantity=',
+ userFoods.quantity,'&userFoodsId=',userFoods.id) AS ndb_no,
+ userFoods.popularity AS popularity, description AS foodDesc,
'userFood' AS fdgrp_cd, 'User saved foods' AS fdgrp_desc
FROM userFoods
%s
@@ -147,7 +149,6 @@ $sql .= sprintf ("
FROM userMeals
%s
",
- $db->_dbConn->Concat("'food='", "userFoods.food", "'&weight='", "userFoods.weight", "'&quantity='", "userFoods.quantity", "'&userFoodsId='", "userFoods.id"),
$userWhere,
$userWhere
);