我已经将我的网站从一个服务器移动到另一个服务器,因为移动我遇到了从MySQL数据库填充下拉的问题。
import ILocationProvider = angular.ILocationProvider;
import IRouteParamsService = angular.route.IRouteParamsService;
import IScope = angular.IScope;
interface ILoginControllerScope extends IScope {
userObject:any;
//...
}
class LoginController {
formType = 'login';
userModel:UserModel;
location:ILocationProvider;
routeParams: IRouteParamsService;
scope:ILoginControllerScope;
static $inject = ['$scope', '$location', 'userModel', '$routeParams'];
constructor($scope, $location, $userModel, routeParams ){
this.scope = $scope;
this.location = $location;
this.userModel = $userModel;
this.routeParams = routeParams;
//...
这就是显示的......
<tr><td>IPad:</td>
<?
$sql="SELECT * FROM ipad_list order by asset asc";
$result=mysql_query($sql);
while (($row=mysql_fetch_array($result))
{
$id1=$row["asset"];
$options1.="<OPTION VALUE=\"$id1\">".$id1.'</option>';
}
?>
<td>
<SELECT NAME="asset">
<OPTION VALUE="0">Choose One</option>
<? echo $options1 ?>
</td></tr>
上面显示的不是我填充的下拉列表。
这在我现有的LAMP服务器上工作正常,但在我的新服务器上没有。我确信php的安装版本是相同的,所以当我移动它时,为什么它不起作用。
答案 0 :(得分:0)
您没有将结果循环到选择标记
<SELECT NAME="asset">
<OPTION VALUE="0">Choose One</option>
<?php
$sql="SELECT * FROM ipad_list order by asset asc";
$result=mysql_query($sql);
while (($row=mysql_fetch_array($result))
{
$id1=$row["asset"];
echo "<OPTION VALUE=".$id1.">".$id1.'</option>';
}
?>
</SELECT>