From 37181c4e7811eedaf47161ec8533052fdac18d89 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Wed, 1 Jul 2015 02:28:16 +0000 Subject: Remove dependence on ADOdb and use PHP PDO instead. --- food_search.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'food_search.php') 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 ); -- cgit v1.2.3