After the death of Ptolemy XI (Alexander II), there was a problem of whom should ascend the throne. Ptolemy IX had two illegitimate sons, one of whom was living in Asia Minor. This son was brought to Egypt, and he ascended the throne under the name of Ptolemy XII, while his younger brother was crowned as King of Cyprus. Ptolemy XII married someone (probably his sister), and her name was Tryphena (later on known as Cleopatra VI). At the beginning, Ptolemy XII wasn't recognized by Rome, and he spent much of his reign and lots of money to win this recognition: he purchased the help of Julius Caesar with 6000 talents, and he was recognized as the friend and ally of Rome.
Shortly afterwards, Rome took Cyprus. Ptolemy XII's brother was forced to commit suicide and the island was lost to Egypt, since the brother didn't give up fighting Rome when they wanted to take the island. Again, this caused many problems for Ptolemy XII in Egypt, as the Egyptians were not satisfied with what was going on. Ptolemy XII went to Rome to press his case. And suggestions were made that one of the two Seleucid princes should marry Bernice, his daughter. However, it seems that Rome interfered and prevented the prince from leaving Syria, and another Seleucid prince appeared in Alexandria and married Bernice.
Ptolemy XII had very little building achievements: he finished the pylons at Edfu where he appeared before Horus, and again on the pylon at Philae. He died before he could do any harm to Egypt. He was known as well by the name 'Ptolemy the Piper'. When he died, there was a will stating that he should be followed by his son Ptolemy and his daughter Cleopatra VII, hoping that they might get married, and Rome would accept this (this happened around the year 51 BC). Some scholars suggested that Ptolemy XII elevated Cleopatra on the throne of Egypt before his death. A papyrus was discovered indicating that the thirteenth year of the rule of Ptolemy XII was the first year of Cleopatra actual rule.
You can get more information here.