简体   繁体   中英

php wrapper library for google appengine access

We have objectify for accessing non-relational database with google appengine in java.

I was wondering if there is any similar library I can use for accessing mysql in google appengine php.

Thanks and regards Rishabbh

Have you had a look at the docs for php and cloud SQL ?

Connecting from App Engine

These following examples show how to connect from a deployed App Engine application using a socket or named pipe that specifies the Cloud SQL instance. When you connect from App Engine, you can use the root user and no password (as shown here), or you can use a specific database user and password.

PDO_MySQL

 $db = new pdo('mysql:unix_socket=/cloudsql/<your-project-id>:<your-instance-name>;dbname=<database-name>', 'root', // username '' // password ); 

mysqli

 $sql = new mysqli(null, 'root', // username '', // password <database-name>, null, '/cloudsql/<your-project-id>:<your-instance-name>' ); 

MySQL API

 $conn = mysql_connect(':/cloudsql/<your-project-id>:<your-instance-name>', 'root', // username '' // password ); mysql_select_db('<database-name'>); 

If you want non-relational data, then Datastore is what you want (rather than MySQL). It has a free tier and can be accessed using this library

https://github.com/tomwalder/php-gds

(disclaimer: I am the author)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM