I have started to learn JSON with PHP. First I wan't to learn, how to create some easy API which will get some data from database from main server and use it in other webpage. I have found some solutions which will get these data into web browser console and not just specific data I need for that web but all data from database.
For example:
DATABASE
id: 1 name: test status: active
id: 2 name: test2 status: disable
INTO TEST.COM WEB
It get just record whos name is TEST and use its status.
$status = RECORD FROM DATABASE;
if ($status == 'disable') {
echo 'THIS WEBPAGE STATUS IS DISABLE';
} else {
echo 'THIS WEBPAGE STATUS IS ACTIVE';
}
Could some one help me with this, please? It looks very east from what I have seen, but just not for me, because I am new with this JSON.
Thanks a lot
json_encode()and jQuery AJAX, then provide a more specific question on what you need help with.