Javascript runs on the client side, while PHP runs on the server side. The Javascript SDK is usually used on the client side, only to enrich the user interface (for example, add a โwelcome X!โ To the screen), and not to collect data and store the database.
However, if you want to save them to the database, you must send them from the client to your server using an AJAX request, for example:
$.post("/your/php/endpoint/here", rows) in jQuery.
But there is a security problem , the user can send information about the offline user, bypassing the Facebook API. So, to store data on the server, I recommend that you receive information on the server.
You can do this in two ways:
source share