Good day everyone!
There is a certain form, when changing the values of which jquery works and sends the .ajax request to the php file. in php file - a string that looks for the required fields in sql DB and throws it out to the user.
The problem is this: If you set up a connection to DB pens in the php file to which ajax refers, then everything is fine, if you just include(); there include(); (or require_once(); ) for the file that contains the connection to the DB , then it swears, it gives 500 error, due to the fact that the $db variable (in which the connection to the database lies) is not defined. At the same time errors that he could not connect the file from include(); - no.
The same thing if I try to connect a file with classes and then call this class. Swears on the fact that
"Class 'ClassName' not found in ..."
Although the error that failed to connect the file in which the class lies - no. Several times I specially set the paths and the bad name of the file - then it swears that such a file was not found.
[Решено]in the title. I rolled this edit as completely unnecessary, and explained why unnecessary. - D-side