Search Posts

Category: mysql

Get JSON data to angularJS module

I am trying to bind json data to angular module. Following is my code. <script> var app = angular.module(‘myApp’,[]); app.controller(‘myCtrl’,function($scope,$http){ $http.get(“list.php”).then(function(response) { $scope.myData =; }); }); </script> <div class=”col-md-12″><!–col 1–> <ul> <li ng-repeat=”z in myData”> {{ z.Type }} </li> </ul> And my list.php file, <?php include_once(“mysql_db/db.php”); $sql = “SELECT * FROM taxitype”; $data = retrieve($sql); // This execute mysqli functions and return an array echo json_encode($data); ?> But it is now displaying list in […]

Update Alasql database details based on existing data

I have an Alasql Database that looks like this: results Name Recieved Bill 10/11/17 7:42 AM Susan 10/05/17 3:43 AM Sarah 10/04/17 2:08 PM I’m trying to update it to convert the Recieved table and convert it into a unix timestamp. This is what I tried: alasql(`UPDATE result SET Recieved = ${new Date(Recieved).getTime()}`); I get this error in Node: ReferenceError: Recieved is not defined How do I use the existing Recieved data from the database […]

select data from mysql with angularjs

I need to select data from a mysql database and handle it with angularjs. I have a database with a table called “mapas”. The columns are id, lat and lng. lat and lng are strings that stores coordinates. Someone can teach me how to select lat and lng from the database and store it on a variable with angularjs? I’ll always have only one line on the table. Would be nice to get the data […]

Angularjs display dynamic ID and info of particular User in $scope when login with Service and API to fetch in MySQL

I had this problem for AngularJS UI. I created a service to fetch a get method api /member/item/ + id, where my parameter id is the specified userID in my database table. I already setup a controller but I keep getting an error. Somehow I manage to get the ID of the user when I declare the value as 1. But I tried to make it dynamic it gives me error. Controller app.controller(‘mainCtrl’, function($scope, $window, […]

AngularJS – POST JSON Array To MySQL Database – PHP

Okay so I am working on a Codeigniter 3.0 application and attempting to post an array of JSON data to the database. But I am not getting an logs regarding the issue and cant seem to find out what I am doing wrong. Any help would be greatly appreciated. Right now here is the following Angular Array: $scope.packageDetails = [ {ID: 1898, Number: 909, Name: “test”, category: “cat”}, {ID: 1899, Number: 919, Name: “test 2”, […]

Error Fetching Data From a PHP Server Running MySQL with Angular JS

I am getting a [$http:baddata] error when my Angular app calls my php file. I’m not sure where the error is triggering exactly, but I believe it’s a problem constructing the json object! I’ve attached all relevant code. Any help would be amazing. Thanks in advance 🙂 Angular documentation shows this This is the PHP file which connects to my database and attempts to return a JSON formatting string back to the calling file <?php […]

Angularjs $http request using rest api

So, I made a todo list using angularjs and made an api using php slim framework and mysql for task storage. I’m trying to use the $http service to save/delete/update tasks in the DB and so far, I came up with this (code below) but since I’m no expert in this matter, there’s probably a lot of crucial mistakes. Keep in mind that, the code regarding the todo list works fine and I’d like some […]