I'll should select first records from table one, where's id column included.
And I'll should select all records from table two, where parent_id column matches table one record id value.

Ofcourse could make with two separated searches, when printing table one info, but would be nice to handle all with one sql, if that's possible.

Thanks for answers.

What you are looking for is a JOIN.

SELECT table1.ID,
table1.field2,
table1.field3,
table2.field2,
table2.field3,
table2.field7
FROM
table1
LEFT JOIN table2 on table1.ID = table2.table1_ID

Something like this will give you all records in table1 and every matching record in table2 or NULL fields for the records with no match in table2.

Be a part of the DaniWeb community

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