聯(lián)系官方銷售客服
1835022288
028-61286886
API接口PHP執(zhí)行文件報錯,麻煩知道的朋友看看為什么會報錯呢?代碼如下:
<?php /** * api 示例文件 * 變量介紹 * $return 表示標準返回變量 */ $return = []; // 返回數(shù)據(jù) // 查詢內(nèi)容 $data = \Phpcmf\Service::M()->db->query("select a.id,a.title,a.keywords,a.description,a.updatetime,a.author,a.hits,addon.content from dr_1_article a left join dr_1_article_data_0 addon on addon.id=a.id where a.id=75"); if ($data) { foreach ($data as $r) { $return[] = [ 'title' => $r['title'], 'keywords' => $r['keywords'], 'description' => $r['description'], 'pubdate' => strftime("%Y-%m-%d %H:%M:%S",$r['updatetime']), 'writer' => $r['author'], 'click' => $r['hits'], 'body' => str_replace('/uploads/',"https://www.yjfglxt.com".'/uploads/', $r['content']) ]; } echo json_encode(['code' => 1, 'msg'=>'ok', 'data' => $rt]);exit; // 強制返回 } return $return;
報錯截圖如下:
回復@迅睿框架技術(shù)-景攸

提示這個是怎么回事呢
請求url是多少
回復@迅??蚣芗夹g(shù)-景攸
這個的請求url是多少
回復@迅??蚣芗夹g(shù)-景攸 https://www.yjfglxt.com/index.php?s=httpapi&id=1&appid=1&appsecret=PHPCMF701208600AF8E&id=75
更新一下
https://www.yjfglxt.com/index.php?s=httpapi&id=1&appid=1&appsecret=PHPCMF701208600AF8E&id=75
重復id了
回復@迅睿框架技術(shù)-景攸 更新了還是無效
https://www.yjfglxt.com/index.php?s=httpapi&id=1&appid=1&appsecret=PHPCMF701208600AF8E&id=75
重復id了
回復@迅睿框架技術(shù)-景攸 請問那個ID重復了呢
回復@迅??蚣芗夹g(shù)-景攸 那么請問如何把ID這個參數(shù)名稱更換一下呢?
第一個ID不能改,第二個是你自己加的可以隨便改名字
回復@迅睿框架技術(shù)-景攸 第二個你幫我改一個變量嘛,我不知道怎么改比較好