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。
  • 相关阅读:
    mysql "The user specified as a definer ('root'@'%') does not exist" 问题
    mysql添加Federated引擎问题
    D7经典脚本[multi/handler]
    redhat7.4安装vertica-9.1.0教程
    批量在当前目录下所有的文件中添加指定字段
    mysql 水平分表技术
    linux普通用户提权
    两步完成利用procdump64+mimikatz获取win用户密码
    hibernate中对象的三种状态分析
    Hibernate 入门案例
  • 原文地址:https://www.cnblogs.com/cf924823/p/5231227.html
Copyright © 2011-2022 走看看