Sending MySQL DB data to JavaScript using PHP

Sending MySQL DB data to JS with help of PHP

Here we discuss about the sending the data from MySQL DB to JS with the help of PHP

Steps :
1. MySQL Connection using PHP (below PHP code is saved as connect.php)

 

2. Retrieve DB data to PHP array.

 

3) (i) Assign PHP value to JS variable

 

3) (ii) Assign PHP value to AngularJS variable (More easy one)

 

Leave a Reply

%d bloggers like this: