diff options
| author | Nathan Kinkade <nath@nkinka.de> | 2015-07-01 02:28:16 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nath@nkinka.de> | 2015-07-01 02:28:16 +0000 |
| commit | 37181c4e7811eedaf47161ec8533052fdac18d89 (patch) | |
| tree | 8088d859b396dbb600269f9613c4df64f87614e4 /food_search.php | |
| parent | 97bc3664869615aa66611cb3788f8e6e15266e53 (diff) | |
Remove dependence on ADOdb and use PHP PDO instead.
Diffstat (limited to 'food_search.php')
| -rw-r--r-- | food_search.php | 9 |
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 ); |
