Home > Article > Backend Development > VB connection database flash code to connect database using PHP
php code:
Copy code The code is as follows:
/* /flashservices/services/Catalog.php */
class Catalog {
var $products_array = array();
// Constructor: Contains the list of Methods Available to the Gateway
Function Catalog () {
$ This-& GT; Methodtable = Array = & gt; & gt; "remote",
"arguments" = & gt; "" // arguments core, not tested
); // End methodtable
}
Function GetProduts () {
/
/
/
/
/ Your Code Goes Here
Return $this->products_array;
}
}
Copy code The code is as follows:
#include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://yourserver. com/flashservices/gateway.php");
gw = NetServices.createGatewayConnection();
CatalogREMOTE = gw.getService("Catalog", this);
CatalogREMOTE.getProducts();
getProducts_Result = function(result) {
_root .products_results = result;
}
The above introduces the code for VB to connect to the database using PHP in Flash, including the content of VB to connect to the database. I hope it will be helpful to friends who are interested in PHP tutorials.