0
我創建通過記錄循環的功能,我想回項目陣列PHP返回數組
if(!function_exists("TicketAttachments")) {
function TicketAttachments($update_sequence) {
global $conn, $pdo_conn;
$results = array();
$sql="SELECT * from ticket_updates where ticketnumber = '".$update_sequence."' and type = 'attachment' ";
$rs=mysql_query($sql,$conn);
while($result=mysql_fetch_array($rs)) {
$results["link"] = 'media/ticket_attachments/'.$result["notes"];
$results["name"] = $result["notes"];
}
return $results;
}
}
我在這裏稱之爲:
$attachments = TicketAttachments($TicketUpdate["sequence"]);
foreach($attachments as $att) {
echo $att["name"];
}
但這呼應h5
而名= 55388-20150929124302-screen dump 28092015.docx
停止使用不推薦使用的函數! – rray
'$ att [「name」];'這行不做任何事。你的意思是「回聲」? – FuzzyTree
檢查我的更新 - 這是我的方式。我一直在測試,並忘記將其添加回 – charlie