<?PHP//introducing the RB entry file include_once' Rb.php '; //define DSN and related data $dsn= ' Mysql:host=localhost;dbname=hwibs_model '; $user= ' Root '; $pass= ' '; $table= ' link '; //Link DatabaseR::setup ($dsn,$user,$pass); //Linked Data Tables $handler= R::d ispense ($table); //Inspect:: Reflection table, returns the field structure of the table//1. Print it out in a one-dimensional array//2. If you do not pass a parameter, it is a one-dimensional array that reflects all of the table names [so if we want to get all the reflection of the table, we can take the second step, in the first step] $result= R::inspect ();//or you can pass a table name in//adddatabase:: Build a communication pipeline [in fact, multiple database handles]R::adddatabase ("J1",$dsn,$user,$pass);//The first parameter is a custom nameR::adddatabase ("J2",$dsn,$user,$pass); R:: Adddatabase ("J3",$dsn,$user,$pass); R:: Adddatabase ("J4",$dsn,$user,$pass); //selectdatabase:: Select an established communication pipeline [do not know the meaning of such a switch is what good???? ]//1. Of course, you can pass in "default" to select a pipeline that you originally set up by Setup.R::selectdatabase ("J4"); R:: Freeze (true); //The transaction operation//1.begin opens a transaction//2. Performs a store operation or exec operation//3. Catches an exception and needs to roll back the transaction//4 if an exception occurs. Otherwise, the transaction is committed normally Try{R::begin (); R:: Store ($handler); R::commit (); }Catch(Exception $e) {R::rollback (); } //Transactional operations:: No big use to see, in fact, is to begin, commit or failure of the rollback system integration,//1. All we have to do is execute SQL//2. But notice that the MySQL auto-commit feature is turned off.R::transaction ("T1"); functionT1 () {Echo' Execute store or exec '; } ?>