所以,我有一个写入 RDS 实例的 php 脚本。但是,我试图插入的一个变量是一个数组值,所以它给我带来了一些麻烦。这是我的代码。任何意见是极大的赞赏。
<?php
session_start();
$name=mysql_real_escape_string($_SESSION['username']);
include 'mysql_connect.php';
// Select the database to use
mysql_select_db("database",$con);
// Describe the now-running instance to get the public URL
$result = $ec2Client->describeInstances(array(
'InstanceIds' => $instanceIds,
));
$server_record = mysql_query("INSERT INTO server_tbl (userName, serverName, serverId, isRunning) VALUES ('$name', 'runtest', '$instanceIds', 'X'");
print_r($instanceIds);
?>