Two questions:
- My table has three fields:
id,parent_id,name. Initiallyidis0, for an element that is a child to the current element, theparent_idis set to theidof the current element....basically, infinite nesting concept. Now I need to find those elements which do not have any children or sub-elements. Any ideas? - What is the best choice to retrieve the
id(auto_increment) of a record I just inserted? mysql_insert_id or last_insert_id, or something else? I need to insert two records simultaneously and use the id(primary key) from the first record as foreign key of second record.