I am trying to create a website with an existing database.
The database has two tables, one of them contain the post info like title, id, content, etc etc,
the other table contains the post ID and the post category.
For example: I want to take a post from a specific category.
$sql = 'SELECT * FROM posts WHERE status = "publish" ORDER BY date DESC LIMIT 10';
This is a simple function, can some one help me please how to modify it, to get the category from the other table and the post info from the other table.
1 Answer