Gateway database connection

I’m developing a program to send a data string series from the ZigBee network to a remote database. I’m using WAMP (MySQL, PHP, Apache) database and SQLite (dbapi) at the gateway, but I don’t get connection. I’m using the gateway connect port X8.
What recommend me that applies?