LiK2BP2O8 and Li3K2BP4O14 are synthesized by high-temperature solution method with the same elements, while contain different fundamental building units. Li3K2BP4O14 is a novel P-O-P linking structure which gives a rare example of violation of Pauling's fourth rule. The electronic structures of LiK2BP2O8 and Li3K2BP4O14 are investigated by density functional calculations. Direct gaps of 5.038 eV (LiK2BP2O8) and 5.487 eV (Li3K2BP4O14) are obtained. By analyzing the density of states (DOS) of LiK2BP2O8 and Li3K2BP4O14, the P-O-P linking in fundamental building units of Li3K2BP4O14 crystal is proved theoretically. Based on the electronic properties, the linear optical information is captured.