我无法获取mysql别名的值

时间:2016-07-02 20:39:54

标签: mysql php

我有以下代码:

<!DOCTYPE html>
<html ng-app="myApp">

<head>
  <script data-require="angular.js@1.4.8" data-semver="1.4.8" src="https://code.angularjs.org/1.4.8/angular.js"></script>
  <link rel="stylesheet" href="style.css" />
  <script src="script.js"></script>
</head>

<body ng-controller="countryCtrl">
  Country : <select ng-model="country" ng-options="country.name for country in countriesWithPhoneCode">
    <option value="">Select country</option>
  </select>
<br/><br/>
 Phone : <input value="{{country.dial_code}}" disabled/>
<input ng-model="phone"/>
<br/>
{{country.name}} - {{country.dial_code}} {{phone}}
</body>

</html>

当我这样做时:

$query =  "
SELECT  distance, outcodepostcodes.lat, outcodepostcodes.lng
    FROM  
      ( SELECT  $table.*, outcodepostcodes.lat, outcodepostcodes.lng ,
                outcodepostcodes.lat*3 AS distance
            FROM  $table
            LEFT JOIN  outcodepostcodes
                  ON UPPER($table.postcode)=outcodepostcodes.outcode 
      ) AS x
    WHERE  $where_no_and
      AND  (hide='0'  OR  hide IS NULL  OR  hide='')
      AND  distance <= 20
    ORDER BY  rent $reihenach
    LIMIT  $offset, $rowsPerPage 
";

$ distance为空

任何帮助表示赞赏

0 个答案:

没有答案