0

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 ?

4
  • 5
    REST is not only "json_encode" its a bit more...please check google Commented Sep 29, 2015 at 6:32
  • possible duplicate of connect AngularJS to mysql using my PHP service? Commented Sep 29, 2015 at 6: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... Commented Sep 29, 2015 at 6: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 ? Commented Sep 29, 2015 at 6:50

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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?
Thanks for your rapid reply, got my answer here: stackoverflow.com/questions/1368014/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.