:::

9-3 上課範例:get_events.php

<?php
include_once "header.php";

$sql = "select  `sn` , `name` , `birthday` from `".$xoopsDB->prefix("contact")."`";
$result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());

$all_content="";
$i=0;
while($all=$xoopsDB->fetchArray($result)){
	//以下會產生這些變數: $tel , $email , $name , $gsn , $sn , $birthday , $zip , $county , $city , $addr
	foreach($all as $k=>$v){
		$$k=$v;
	}
  $myEvents[$i]['id']=$sn;
  $myEvents[$i]['title']=$name;
  $myEvents[$i]['start']=strtotime($birthday);
  $i++;
}

echo json_encode($myEvents);
?>

:::

搜尋

QR Code 區塊

https%3A%2F%2Fwww.tad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D26%26tbdsn%3D777

書籍目錄

展開 | 闔起

線上使用者

21人線上 (10人在瀏覽線上書籍)

會員: 0

訪客: 21

更多…