1 Star 1 Fork 0

yvsm/Program-O

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
getbots.php 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
Dave Morton 提交于 2016-07-14 18:29 . New Features, and Minor bug fixes
<?php
/***************************************
* http://www.program-o.com
* PROGRAM O
* Version: 2.6.3
* FILE: getbots.php
* AUTHOR: Elizabeth Perreau and Dave Morton
* DATE: MAY 17TH 2014
* DETAILS: Searches the database for all active chatbots, returning a JSON encoded array of ID/name pairs
***************************************/
$time_start = microtime(true);
$script_start = $time_start;
$last_timestamp = $time_start;
$thisFile = __FILE__;
require_once("config/global_config.php");
//load shared files
require_once(_LIB_PATH_ . 'PDO_functions.php');
include_once (_LIB_PATH_ . "error_functions.php");
include_once(_LIB_PATH_ . 'misc_functions.php');
ini_set('error_log', _LOG_PATH_ . 'getbots.error.log');
$dbConn = db_open();
$sql = "select `bot_id`, `bot_name` from `$dbn`.`bots`;";
$result = db_fetchAll($sql, null, __FILE__, __FUNCTION__, __LINE__);
$bots = array('bots'=>array());
foreach ($result as $row)
{
$bot_id = $row['bot_id'];
$bot_name = $row['bot_name'];
$bots['bots'][$bot_id] = $bot_name;
}
header('Content-type: application/json');
$out = json_encode($bots);
exit($out);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/zunyunkeji/Program-O.git
git@gitee.com:zunyunkeji/Program-O.git
zunyunkeji
Program-O
Program-O
master

搜索帮助