Hello Readers If you want to hit the MySql queries from another page by your current page, The by using Angular js you can do this. Also angular js will offers you to show your records in a pre formated desing.
Let's see the example as below:-
<!DOCTYPE html>
<html >
</style>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="StudentID">
<table>
<tr ng-repeat="x in names">
<td>{{ x.School}}</td>
<td>{{ x.City}}</td>
</tr>
</table>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('StudentID', function($scope, $http) {
$http.get("www.ururl/file/mysql.php")
.then(function (response) {$scope.names = response.data.records;});
});
</script>
</body>
</html>
Now in above code you just have to sepcify the page where mysql query is written. And its result will be shown in your current page.
0 Comment(s)