MySQL Forums
Forum List  »  PHP

Re: How to get API data into a MySQL
Posted by: Rick James
Date: January 05, 2015 06:15PM

A user-facing web page cannot call MySQL directly.

A user-facing web page can ask the server to perform some SQL for you in two main ways:

*** Form & second page:
1. Have a <form> on the page; the user fills out the fields and "submits" the form.
2. A PHP (or whatever) script on the server performs whatever you programmed, presumably including some SQL based on the <form> values.
3. That script also loads another page (or to an new copy of the same page) for the user.

*** AJAX, staying on same page:
1. Use AJAX to asynchronously "send" a request to the server. Values for the request could come from <input> fields (or whatever).
2. A server page (in PHP or whatever) responds to the AJAX call and does the SQL (or whatever).
3. The page (still the original page) can either ignore the return, or do something fancy with it. The 'user' does not 'leave' the current web page; JavaScript is doing the coding (but not the actual MySQL request).

Whatever details are missing is left to whatever person is reading this. Whatever.

Options: ReplyQuote


Subject
Written By
Posted
Re: How to get API data into a MySQL
January 05, 2015 06:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.