how to create binary tree method in mysql

If you are referring to a simple master, detail type relationship I normally do something like this:

CREATE TABLE `master` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Invoice_Date` Date() Default null,
`Customer_Name` VARCHAR(55) default NULL,
`Customer_Address` VARCHAR(55) default NULL,
`other_fields` VARCHAR(55) default NULL
PRIMARY KEY (`ID`))
CREATE TABLE `detail` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Master_ID` int(11) Default NULL,
`ItemNumber` varchar(20) Default null,
`QuantityOrdered` smallint(5) default NULL,
`QuantityShipped` smallint(5) default NULL,
`other_fields` VARCHAR(55) default NULL
PRIMARY KEY (`ID`))

Then the Master_id relates the detail item back to the master record. If your trying to do something else give a better explanation please.

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.