How to insert data from a form made in Angular2 in a Database?

-1

I'm starting to learn Angular 2, and I have to do a CRUD of a system on series, and I need to store data in a database, I currently know how to use MySQL using Xampp.

I need to make the request using Ajax. Here is the function you want to call the PHP file:

Below,thefile'registerSerie.php':

IamtestingthefunctionofthefirstimageusingngservetoactivatetheHTTPserverfortheAngular,butthePHPfiledoesnotwork,IbelieveitisforlackofaMySQLserversimilartotheonethatXamppactivates,sinceIknowtheAngularisClient-side,andserver-sidePHP.

1-HowcanIconnecttothebank?

2-HowcanI"call" the server-side?

Thank you in advance.

    
asked by anonymous 03.07.2018 / 02:47

1 answer

0

The solution to this problem using xampp is:

  • Put all PHP files in the hampions folder of xampp.
  • Develop the Web application and use the ng build command to compile the system.
  • Get the 'dist' folder that was created inside the project and copy it to the htdocs folder.
  • Open xampp, connect Apache server and if necessary MySQL.
  • Access the application.
  • 03.07.2018 / 12:39