AngularJS GET ajax request with PHP (Fetching data)

In this tutorial, i will be explaining how to fetch data from the mysql database via angularjs via GET ajax call. I will be using angularjs $http service to get data from the mysql database with php.

Note: create a mysql database, with students table having two fields Name(varchar), Roll(int). Also insert some values.

Copy the following contents to their respective file & you are done.

index.html

 fetch.php

 

  • Shen Siddharta Excel

    It’s working

    But not safe

  • Mahantesh Policepatil

    Hello Guys,

    About code is working fine but i need a help.

    Instead of textbox,
    I want to use combo box
    i mean

    instead of the above i am using

    {{students.name}}

    but i am not getting values in combo box

  • manish

    display the result
    NAME ROLL NO
    {{STUDENTS.NAME}} {{STUDENTS.ROLL}}
    why view the database value?
    what the errors?

  • Rohit Gautam

    thanks it working for me 🙂