zoukankan      html  css  js  c++  java
  • AngularJS SQL

    使用 PHP 从 MySQL 中获取数据

     <style>

    table, th , td  {
      border: 1px solid grey;
      border-collapse: collapse;
      padding: 5px;
    }
    table tr:nth-child(odd) {
      background-color: #f1f1f1;
    }
    table tr:nth-child(even) {
      background-color: #ffffff;
    }
    </style>
    </head>
    <body>

    <div ng-app="myApp" ng-controller="customersCtrl">
     
    <table>
      <tr ng-repeat="x in names">
        <td>{{ x.Name }}</td>
        <td>{{ x.Country }}</td>
      </tr>
    </table>
     
    </div>
     
    <script>
    var app = angular.module('myApp', []);
    app.controller('customersCtrl', function($scope, $http) {
       $http.get("/try/angularjs/data/Customers_MySQL.php")
       .success(function (response) {$scope.names = response.records;});
    });
    </script>

    ASP.NET 中执行 SQL 获取数据

    <style>
    table, th , td  {
      border: 1px solid grey;
      border-collapse: collapse;
      padding: 5px;
    }
    table tr:nth-child(odd) {
      background-color: #f1f1f1;
    }
    table tr:nth-child(even) {
      background-color: #ffffff;
    }
    </style>
    </head>
    <body>
    <div ng-app="myApp" ng-controller="customersCtrl"> 
    <table>
    <tr ng-repeat="x in names">
    <td>{{ x.Name }}</td>
    <td>{{ x.Country }}</td>
    </tr>
    </table>
    </div>
    <script>
    var app = angular.module('myApp', []);
    app.controller('customersCtrl', function($scope, $http) {
       $http.get("http://www.runoob.com/try/angularjs/data/Customers_SQL.aspx")
       .success(function (response) {$scope.names = response.records;});
    });
    </script>

    服务端代码


    以下列出了列出了几种服务端代码类型:

    1. 使用 PHP 和 MySQL。返回 JSON。
    2. 使用 PHP 和 MS Access。返回 JSON。
    3. 使用 ASP.NET, VB, 及 MS Access。 返回 JSON。
    4. 使用 ASP.NET, Razor, 及 SQL Lite。 返回 JSON。
  • 相关阅读:
    Nginx作为缓存服务
    Nginx作为代理服务
    ZipUtils zip压缩实现
    getman九桃小说解析油猴脚本
    maven添加代理加速jar包下载
    ffmpeg MP3 flv 视频转mp3
    ActiveMQ配置用户认证信息
    JS实现HTML标签转义及反转义
    删除registry镜像数据,以centos为例
    启动一个带登录账号密码的registry容器
  • 原文地址:https://www.cnblogs.com/cf924823/p/5231227.html
Copyright © 2011-2022 走看看