# Php file to give json data from mysql

**URL:** <https://discuss.emberjs.com/t/php-file-to-give-json-data-from-mysql/6163>\
**Category:** Ember Data\
**Created:** [September 1, 2014, 12:08am UTC](https://discuss.emberjs.com/t/php-file-to-give-json-data-from-mysql/6163 "2014-09-01T00:08:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mourahi](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mourahi/32/9457_2.png) [@mourahi](https://discuss.emberjs.com/u/mourahi)\
**Post date:** [September 1, 2014, 12:08am UTC](https://discuss.emberjs.com/t/php-file-to-give-json-data-from-mysql/6163/1 "2014-09-01T00:08:58Z")

</div>

I need to use Ember data to retrieve a json data from php file. All the examples explain how to use json data from a external server , but for me, the application emberjs and my file php json are in same server . simple file php to generate json from mysql . you have an idea? Thanks!

---

<div class="post-metadata">

**Author:** ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)\
**Post date:** [September 1, 2014, 12:42am UTC](https://discuss.emberjs.com/t/php-file-to-give-json-data-from-mysql/6163/2 "2014-09-01T00:42:31Z")

</div>

You are still getting data from an external server, it just happens to be on the same host. Remember that your Ember application is running in the consumers browser, not your server. So from the standpoint of Ember Data you are in the exact same boat as the guides assume.

Essentially, you need to have a PHP endpoint that responds RESTFully with the proper payloads.

---

<div class="post-metadata">

**Author:** ![mourahi](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/mourahi/32/9457_2.png) [@mourahi](https://discuss.emberjs.com/u/mourahi)\
**Post date:** [September 1, 2014, 1:08am UTC](https://discuss.emberjs.com/t/php-file-to-give-json-data-from-mysql/6163/3 "2014-09-01T01:08:40Z")

</div>

ok, you are right. i try my project in localhost, and i am stropping in this code :

```
App.Store = DS.Store.extend({
       adapter: DS.RESTAdapter.create({
            url:"http://127.0.0.1/db/articles.php"
      })
});

```

the articles.php is the json genertor with a header of course . what do you think ?
