这里超级新手,仅使用PHP创建我的json数据,并且很难理解语法。下面是一些偏代码:如何从PHP查询中获取字段值(PDO)
所有我试图做的是检索值“2af8ddda-2be4-11e5-9453-b82a72d52c35”并把它放在变量@sharepointID:
function selectWithSharepointID($table, $columns, $where){
try{
//Get Sharepoint file ID first
$stmt = $this->db->prepare("SELECT ID FROM table1 ORDER BY DownloadedTimeStamp DESC LIMIT 1");
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
//$data[] = array("ID" => $rows['ID']);
//$sharepointID = $data[0];
//$sharepointID = $rows[0];
$where = array('id'=>$sharepointID);
//$where = array('id'=>'2af8ddda-2be4-11e5-9453-b82a72d52c35'); //this works fine
...
PS:还试图使用print_r和echo但无法看到控制台中的任何内容。
谢谢
感谢奏效! – Max