Silverstripe Version: 4.1
Question:
In a js file (inside public/resources/themes/my_thema/javascript) I make an ajax call according to the jquery standard.
the php file of the call I put it in public/class/myfile.php
Here a call a query to Silverstripe db so to the beggining of the file I put
use Silverstripe/ORM/DB
Details of your query go here
// Include any relevant code. If you have a lot of code, link to a gist instead.