![]() | 1 CoX 2012-08-17 11:13:54 +08:00 有没有添加并绑定数据库呢? |
![]() | 3 7anshuai 2012-08-17 13:02:26 +08:00 我用appfog services设置下的php code samples很顺利的连接了数据库 |
![]() | 5 7anshuai 2012-08-20 14:29:15 +08:00 ![]() @helloboy php code samples代码如下: $services_json = json_decode(getenv("VCAP_SERVICES"),true); $mysql_cOnfig= $services_json["mysql-5.1"][0]["credentials"]; $username = $mysql_config["username"]; $password = $mysql_config["password"]; $hostname = $mysql_config["hostname"]; $port = $mysql_config["port"]; $db = $mysql_config["name"]; |