0

I'd like to know if it's possible to turn a Json file API like this one :

http://graph.facebook.com/10152830671619648/photos?fields=id,name,source

to a MySQL data table in a database.

What language shall I use for this ? PHP, Javascript ?

Thanks for answering !

EDIT : Actually, I'd like to create a system to manage the comics I need to buy with a simple interface. All the information about a comic book will be stored in a database (id, name, image link, if I need it, if I have it, if I read it).

1 Answers1

0

In PHP, there are several ways to get the JSON object from url including fopen, get_file_contents and curl, the latter being the more reliable option if there are restrictions on the server.

JSON url to PHP object: - Get JSON object from URL

Serialize and store to db: - How do I store an php object in a MySQL table?

or write object properties to db table columns: - mysqli: http://php.net/manual/en/mysqli-stmt.bind-param.php pdo: - http://php.net/manual/en/pdostatement.bindparam.php

JavaScript can be used as well, using Ajax to both retrieve the JSON object and to store it in the db e.g. by sending it to a server-side script which do the storing. You can use PHP, PHP and JavaScript (Ajax), JavaScript and some JavaScript Ajax APIs, etc.

Community
  • 1
  • 1
George O.
  • 64
  • 2