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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.