can anybody give me query of current version of my sql of
$sql = "SELECT entries.*, catagories.cat FROM entries, catagories
WHERE entries.cat_id = catagories.id
ORDER BY dateposted DESC
LIMIT 1;";
i will be thankful.
can anybody give me query of current version of my sql of
$sql = "SELECT entries.*, catagories.cat FROM entries, catagories
WHERE entries.cat_id = catagories.id
ORDER BY dateposted DESC
LIMIT 1;";
i will be thankful.
INNER JOIN is what you looking for.
SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
The Link below will give you a better understanding.
http://www.w3schools.com/sql/sql_join_inner.asp
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.