I want to create a web application, where i can load data on run time through JavaScript(angularJS), my friend told me to use restful API for the conversion of data from MySQL to JSON format, the thing which is confusing me is that why should I use Restful API, when I can use the simple php function "json_enocode". What other functionalities and benefits, i get when i use Restful API ?
Asked
Active
Viewed 656 times
0
-
5REST is not only "json_encode" its a bit more...please check google – ThaDafinser Sep 29 '15 at 06:32
-
possible duplicate of [connect AngularJS to mysql using my PHP service?](http://stackoverflow.com/questions/11277429/connect-angularjs-to-mysql-using-my-php-service) – Maheshwar Ligade Sep 29 '15 at 06:38
-
Rest full is not to use for just to encode data to json, you can do it using just angulat.toJson (yourObject). The thing is when you bulding a web application data you use in rest API available for rest call,you can use it for your other applications allso. An rest help you to build spa concept to a huge data transactions also.There are many usage of Rest study and have fun... – Mohamed Nizar Sep 29 '15 at 06:38
-
As of now, I know that Restful API can encode the MySQL data to JSON and the conditional statement which I use in my query at where clause like "where id=1" is equivalent to "siteaddress/?id=1". Can you tell me what other functionalities and benefits I get other than that when i use Restful API ? or can you give me a good link where i can find this ? – mhk Sep 29 '15 at 06:50
1 Answers
0
Restful API is not data encoding structure. I would suggest you read more about restful API and decide whether you need to create API for you web application or not.
Either way you'll use json_encode to encode your data to json. So, you don't need to create restful API to convert data to json.

LIMEXS
- 181
- 4
-
As of now, I know that Restful API can encode the MySQL data to JSON and the conditional statement which I use in my query at where clause like "where id=1" is equivalent to "siteaddress/?id=1". Can you tell me what other functionalities and benefits I get other than that when I use Restful API ? or can you give me a good link where i can find this? – mhk Sep 29 '15 at 06:52
-
I hope this link will be helpful https://en.wikipedia.org/wiki/Representational_state_transfer – LIMEXS Sep 29 '15 at 06:59
-
Thanks for your rapid reply, got my answer here: http://stackoverflow.com/questions/1368014/why-do-we-need-restful-web-services – mhk Sep 29 '15 at 19:16