本文整理汇总了PHP中DbConnect::fetchassoc方法的典型用法代码示例。如果您正苦于以下问题:PHP DbConnect::fetchassoc方法的具体用法?PHP DbConnect::fetchassoc怎么用?PHP DbConnect::fetchassoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbConnect
的用法示例。
在下文中一共展示了DbConnect::fetchassoc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showSMSqueue
public function showSMSqueue()
{
$smsPath = 'content/tsms/';
$tsms_host = $this->settings['WATCHDOG_TSMS_GATEWAY'];
$tsms_db = 'users';
$tsms_login = $this->settings['WATCHDOG_TSMS_LOGIN'];
$tsms_password = $this->settings['WATCHDOG_TSMS_PASSWORD'];
$tsms_table = $this->settings['WATCHDOG_TSMS_LOGIN'];
$smsArray = array();
$TsmsDB = new DbConnect($tsms_host, $tsms_login, $tsms_password, $tsms_db, $error_reporting = true, $persistent = false);
$TsmsDB->open() or die($TsmsDB->error());
$TsmsDB->query('SET NAMES utf8;');
if (wf_CheckPost(array('showdate'))) {
$date = mysql_real_escape_string($_POST['showdate']);
} else {
$date = '';
}
if (!empty($date)) {
$where = " WHERE `send_time` LIKE '" . $date . "%' ORDER BY `id` DESC;";
} else {
$where = ' ORDER BY `id` DESC LIMIT 50;';
}
$query = "SELECT * from `" . $tsms_table . "`" . $where;
$TsmsDB->query($query);
while ($row = $TsmsDB->fetchassoc()) {
$smsArray[] = $row;
}
//close old datalink
$TsmsDB->close();
//rendering result
$inputs = wf_DatePickerPreset('showdate', curdate());
$inputs .= wf_Submit(__('Show'));
$dateform = wf_Form("", 'POST', $inputs, 'glamour');
$lighter = 'onmouseover="this.className = \'row2\';" onmouseout="this.className = \'row3\';" ';
$cells = wf_TableCell(__('ID'));
$cells .= wf_TableCell(__('Msg ID'));
$cells .= wf_TableCell(__('Mobile'));
$cells .= wf_TableCell(__('Sign'));
$cells .= wf_TableCell(__('Message'));
$cells .= wf_TableCell(__('WAP'));
$cells .= wf_TableCell(__('Cost'));
$cells .= wf_TableCell(__('Send time'));
$cells .= wf_TableCell(__('Sended'));
$cells .= wf_TableCell(__('Status'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($smsArray)) {
foreach ($smsArray as $io => $each) {
$cells = wf_TableCell($each['id']);
$cells .= wf_TableCell($each['msg_id']);
$cells .= wf_TableCell($each['number']);
$cells .= wf_TableCell($each['sign']);
$msg = wf_modal(__('Show'), __('SMS'), $each['message'], '', '300', '200');
$cells .= wf_TableCell($msg);
$cells .= wf_TableCell($each['wappush']);
$cells .= wf_TableCell($each['cost']);
$cells .= wf_TableCell($each['send_time']);
$cells .= wf_TableCell($each['sended']);
$cells .= wf_TableCell($each['status']);
$rows .= wf_tag('tr', false, 'row3', $lighter);
$rows .= $cells;
$rows .= wf_tag('tr', true);
}
}
$result = $dateform;
$result .= wf_TableBody($rows, '100%', '0', 'sortable');
return $result;
}
示例2: DbConnect
function zb_AsteriskQuery($query)
{
global $asteriskHost, $asteriskDb, $asteriskTable, $asteriskLogin, $asteriskPassword, $asteriskCacheTime;
$asteriskDB = new DbConnect($asteriskHost, $asteriskLogin, $asteriskPassword, $asteriskDb, $error_reporting = true, $persistent = false);
$asteriskDB->open() or die($asteriskDB->error());
$result = array();
$asteriskDB->query('SET NAMES utf8;');
$asteriskDB->query($query);
while ($row = $asteriskDB->fetchassoc()) {
$result[] = $row;
}
$asteriskDB->close();
return $result;
}
示例3: renderTurboSMSQueue
/**
* Render TurboSMS server-side queue
*
* @return string
*/
public function renderTurboSMSQueue()
{
$result = '';
$tsms_host = $this->settings['TSMS_GATEWAY'];
$tsms_db = 'users';
$tsms_login = $this->settings['TSMS_LOGIN'];
$tsms_password = $this->settings['TSMS_PASSWORD'];
$tsms_table = $this->settings['TSMS_LOGIN'];
$smsArray = array();
$total = 0;
$TsmsDB = new DbConnect($tsms_host, $tsms_login, $tsms_password, $tsms_db, $error_reporting = true, $persistent = false);
$TsmsDB->open() or die($TsmsDB->error());
$TsmsDB->query('SET NAMES utf8;');
if (wf_CheckPost(array('showdate'))) {
$date = mysql_real_escape_string($_POST['showdate']);
} else {
$date = '';
}
if (!empty($date)) {
$where = " WHERE `send_time` LIKE '" . $date . "%' ORDER BY `id` DESC;";
} else {
$where = ' ORDER BY `id` DESC LIMIT 50;';
}
$query = "SELECT * from `" . $tsms_table . "`" . $where;
$TsmsDB->query($query);
while ($row = $TsmsDB->fetchassoc()) {
$smsArray[] = $row;
}
//close old datalink
$TsmsDB->close();
//rendering result
$inputs = wf_DatePickerPreset('showdate', curdate());
$inputs .= wf_Submit(__('Show'));
$dateform = wf_Form("", 'POST', $inputs, 'glamour');
$cells = wf_TableCell(__('ID'));
$cells .= wf_TableCell(__('Msg ID'));
$cells .= wf_TableCell(__('Mobile'));
$cells .= wf_TableCell(__('Sign'));
$cells .= wf_TableCell(__('Message'));
$cells .= wf_TableCell(__('Balance'));
$cells .= wf_TableCell(__('Cost'));
$cells .= wf_TableCell(__('Send time'));
$cells .= wf_TableCell(__('Sended'));
$cells .= wf_TableCell(__('Status'));
$rows = wf_TableRow($cells, 'row1');
if (!empty($smsArray)) {
foreach ($smsArray as $io => $each) {
$cells = wf_TableCell($each['id']);
$cells .= wf_TableCell($each['msg_id']);
$cells .= wf_TableCell($each['number']);
$cells .= wf_TableCell($each['sign']);
$msg = wf_modal(__('Show'), __('SMS'), $each['message'], '', '300', '200');
$cells .= wf_TableCell($msg);
$cells .= wf_TableCell($each['balance']);
$cells .= wf_TableCell($each['cost']);
$cells .= wf_TableCell($each['send_time']);
$cells .= wf_TableCell($each['sended']);
$cells .= wf_TableCell($each['status']);
$rows .= wf_TableRow($cells, 'row5');
$total++;
}
}
$result .= wf_Link(self::URL_ME, __('Back'), true, 'ubButton');
$result .= $dateform;
$result .= wf_TableBody($rows, '100%', '0', 'sortable');
$result .= __('Total') . ': ' . $total;
return $result;
}