Database selection

There are a couple of signs, they contain certain information (for example: tables(cars,news)). The task is this: I’m doing a site search and don’t know how to make a selection from 2 or more tables, thanks in advance.

p.s I would like to know how to implement this in ajax, that is, it is already looking for what you wrote in the process.


Answer 1, authority 100%

Create an ajax.php file, make a request to this script via javascript, jquery, prototype, mootools, etc., as you like, immediately get data from the database using the above method, that is, a join, and return everything to echo json_encode($danniye)format, do evalJSON(true)in the script itself, enumerate for inand be happy. ))


Answer 2

The so-called “jax” does not search the database directly, of course you can do it – CouchDB with a rest interface, but that’s not about it.

SELECT * FROM cars JOIN news ON //...