title: Search in a SQL database with AngularJS
body: <p>i'm trying to list the elements of a MySQL database using AngularJS. 
  Despite some research, i can't find what to write in the controller function to do that.</p>
  
  <p>To be more precise, i previously did it without AngularJS using the following :</p>
  
  <pre><code>$link = new PDO('mysql:host=localhost;dbname=mygaloo;charset=utf8', 'root', ''); 
  $query = $link-&gt;query("SELECT * FROM ".$choice." WHERE nom LIKE '%".$request."%' ORDER BY id DESC"); 
  </code></pre>
  
  <p>Here's my current code :</p>
  
  <pre><code>&lt;div ng-app="searchApp" ng-controller="searchController"&gt; 
      &lt;table&gt;
          &lt;tr ng-repeat="x in objects"&gt;
              &lt;td&gt;{{ x.name }}&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
      var app = angular.module('searchApp', []);
      app.controller('searchController', function($scope) 
      {
          //What should i do here ?
      });
  &lt;/script&gt;
  </code></pre>