本文整理匯總了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;
}