-4
我的數組不返回像杜澤「價值如何pg_escape_string在數組中返回值
$query= "select vmname,guid,hostid,guestosname from vmobjects";
AddLog("infrastructure.php","Query: ".$query,ERR_DEBUG_LOW);
$result = pg_query($conn,$query);
$no_records=pg_num_rows($result);
$j=$no_records;
$i=0;
while($row = pg_fetch_array($result))
{
if($row[3]=="")
{
$vmobj_Array[$i]=$row[0].'***'.$row[1].'***'.$row[2];
}
else
{
$vmobj_Array[$i]=$row[0].'***'.$row[1].'***'.$row[2];
}
$i++;
}
這是我的其他網頁
$username_escaped = pg_escape_string($username);
$password_escaped = pg_escape_string($password);
$name_escaped = pg_escape_string($name);
$query = "insert into vmobjects (guid,ipaddress,username,password,hostid,vmname,guestostype) values('".$guid."','".$ip."','".$username_escaped."','".$password_escaped."','".$hostid."','".$name_escaped."','".strtolower($os)."')";
根本沒有細節 – emaillenin 2011-05-19 09:02:34