本文整理汇总了PHP中Sql_Result函数的典型用法代码示例。如果您正苦于以下问题:PHP Sql_Result函数的具体用法?PHP Sql_Result怎么用?PHP Sql_Result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Sql_Result函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connectDB
<?php
include_once "../lib/common.php";
$cn = connectDB();
$arrayInput = array();
$query = "select host_name,server1,server2 from tbl_dns_servers";
$result = Sql_exec($cn, $query);
if (!$result) {
echo "err+" . $query . " in line " . __LINE__ . " of file" . __FILE__;
exit;
}
$data = array();
$i = 0;
while ($row = Sql_fetch_array($result)) {
$j = 0;
$data[$i][$j++] = Sql_Result($row, "host_name");
$data[$i][$j++] = Sql_Result($row, "server1");
$data[$i][$j++] = Sql_Result($row, "server2");
$i++;
}
Sql_Free_Result($result);
ClosedDBConnection($cn);
echo json_encode($data);
示例2: header
<?php
//session_start();
header('Access-Control-Allow-Origin: *');
require_once "../lib/common.php";
//require_once "../Lib/filewriter.php";
//print_r($info);
//print_r($_SESSION);
//exit;
//
$cid = $_POST["info"];
//echo $cid;
$cn = connectDB();
//$qry = "select * from `bwc_ruleinfo`";
$qry = "select * from `bwc_ruleinfo` where `clientId`='{$cid}'";
$rs = Sql_exec($cn, $qry);
$data = array();
$i = 0;
while ($row = Sql_fetch_array($rs)) {
$j = 0;
$data[$i][$j++] = Sql_Result($row, "ruleId");
$data[$i][$j++] = Sql_Result($row, "src");
$data[$i][$j++] = Sql_Result($row, "dst");
$data[$i][$j++] = Sql_Result($row, "port");
$data[$i][$j++] = Sql_Result($row, "mac");
$data[$i][$j++] = Sql_Result($row, "percentage");
$i++;
}
echo json_encode($data);
ClosedDBConnection($cn);
示例3: Sql_fetch_array
$dt = Sql_fetch_array($res);
$dbtype = $dt['db_type'];
$Server = $dt['db_server'];
$UserID = $dt['db_uid'];
$Password = $dt['db_password'];
$Database = $dt['db_name'];
ClosedDBConnection($cn);
$remoteCn = connectDB();
$qry = "SELECT `msgID`,`msg`,`srcMN`, `dstMN`, `writeTime`, `msgStatus` FROM `smsoutbox`";
$rs = Sql_exec($remoteCn, $qry);
$data = array();
$i = 0;
while ($row = Sql_fetch_array($rs)) {
$status = Sql_Result($row, "msgStatus");
$j = 0;
$data[$i][$j++] = Sql_Result($row, "msgID");
$data[$i][$j++] = Sql_Result($row, "msg");
$data[$i][$j++] = Sql_Result($row, "srcMN");
$data[$i][$j++] = Sql_Result($row, "dstMN");
$data[$i][$j++] = Sql_Result($row, "writeTime");
$data[$i][$j++] = $status;
if ($status == "FAILED") {
$data[$i][$j++] = '<button style="background-color: blue; margin: 2px;" onclick="Resend(this,' . "'" . Sql_Result($row, "msgID") . "'" . '); return false;" class="btn btn-primary" type="button"> <i class="fa fa-pencil-square-o"></i> Resend
</button>';
} else {
$data[$i][$j++] = '';
}
$i++;
}
echo json_encode($data);
ClosedDBConnection($remoteCn);
示例4: connectDB
* Date: 4/27/2015
* Time: 1:31 PM
*/
include_once "../lib/common.php";
$cn = connectDB();
$arrayInput = array();
$query = "SELECT * FROM tbl_nat_static";
$result = Sql_exec($cn, $query);
if (!$result) {
echo "err+" . $query . " in line " . __LINE__ . " of file" . __FILE__;
exit;
}
$data = array();
$i = 0;
while ($row = Sql_fetch_array($result)) {
$j = 0;
$data[$i][$j++] = Sql_Result($row, "name");
$data[$i][$j++] = Sql_Result($row, "direction");
$data[$i][$j++] = Sql_Result($row, "interface");
$data[$i][$j++] = Sql_Result($row, "destination_ip");
$data[$i][$j++] = Sql_Result($row, "destination_port");
$data[$i][$j++] = Sql_Result($row, "forward_ip");
$data[$i][$j++] = Sql_Result($row, "forward_port");
$data[$i][$j++] = '<button style="background-color: blue; margin: 2px;" onclick="edit_input_form_nat_static(this,' . "'" . Sql_Result($row, "id") . "'" . '); return false;" class="btn btn-primary" type="button"> <i class="fa fa-pencil-square-o"></i> Edit
</button>' . '<button style="background-color: #FF0000;margin: 2px; " onclick="delete_nat_static(this,' . "'" . Sql_Result($row, "id") . "'" . '); return false;" class="btn btn-primary" type="button"> <i class="fa fa-times"></i> Delete
</button>';
$i++;
}
Sql_Free_Result($result);
ClosedDBConnection($cn);
echo json_encode($data);
示例5: connectDB
<?php
include_once "../lib/common.php";
$cn = connectDB();
$query = "SELECT DISTINCT `table_name`,`page_name`\n\t\t FROM `tbl_audit_trail` \n\t\t ORDER BY `table_name` ASC";
$result = Sql_exec($cn, $query);
if (!$result) {
echo "err+" . $query . " in line " . __LINE__ . " of file" . __FILE__;
exit;
}
$options = '<option value="">--Select--</option>';
while ($row = Sql_fetch_array($result)) {
$tbl_name = Sql_Result($row, "table_name");
$tbl_name = Sql_Result($row, "page_name");
$options .= '<option value="' . $tbl_name . '">' . $tbl_name . '</option>';
}
Sql_Free_Result($result);
ClosedDBConnection($cn);
echo $options;
示例6: Sql_exec
$extraBtn = false;
//echo $count_qry;$load_qry;
$res = Sql_exec($remoteCn, $load_qry);
$i = 0;
$data = array();
while ($row = Sql_fetch_array($res)) {
$j = 0;
$data[$i] = array();
$data[$i][$j++] = Sql_Result($row, "log_server_time");
$data[$i][$j++] = Sql_Result($row, "source");
$data[$i][$j++] = Sql_Result($row, "type");
$data[$i][$j++] = Sql_Result($row, "source_timestamp");
$data[$i][$j++] = Sql_Result($row, "from_user");
$data[$i][$j++] = Sql_Result($row, "to_user");
$data[$i][$j++] = Sql_Result($row, "call_id");
$data[$i][$j++] = Sql_Result($row, "caller_callee");
$data[$i][$j++] = Sql_Result($row, "source_ip");
$data[$i][$j++] = Sql_Result($row, "source_port");
$data[$i][$j++] = Sql_Result($row, "function_name");
$data[$i][$j++] = Sql_Result($row, "audio_ip");
$data[$i][$j++] = Sql_Result($row, "audio_port");
$data[$i][$j++] = Sql_Result($row, "video_ip");
$data[$i][$j++] = Sql_Result($row, "video_port");
$data[$i][$j++] = Sql_Result($row, "function_point");
$data[$i][$j++] = Sql_Result($row, "comment");
$data[$i][$j++] = Sql_Result($row, "sip");
$i++;
}
Sql_Free_Result($res);
echo json_encode($data);
ClosedDBConnection($remoteCn);
示例7: Sql_Result
$show_response .= '<div class=" col-md-4" style="background-color:lightgreen ; overflow:auto; border-radius:5px;" >';
$show_response .= Sql_Result($row, "new_value");
$show_response .= '</div>';
} elseif (trim($action_command) == "delete") {
$show_response .= '<div class=" col-md-4" style="background-color:salmon ; overflow:auto; border-radius:5px;" >';
$show_response .= Sql_Result($row, "old_value");
$show_response .= '</div>';
$show_response .= '<div class=" col-md-1">';
$show_response .= '</div>';
$show_response .= '<div class=" col-md-4">';
$show_response .= '<img src="rcportal/img/empty.jpg">';
// img -> for old value
$show_response .= '</div>';
} else {
$show_response .= '<div class=" col-md-4" style="background-color:salmon; overflow:auto; border-radius:5px;" >';
$show_response .= Sql_Result($row, "old_value");
$show_response .= '</div>';
$show_response .= '<div class=" col-md-1">';
$show_response .= '</div>';
$show_response .= '<div class=" col-md-4">';
$show_response .= '<img src="rcportal/img/empty.jpg">';
// img -> for old value
$show_response .= '</div>';
}
$show_response .= '</div>';
$show_response .= '</div>';
}
Sql_Free_Result($result);
$data['response'] = $show_response;
ClosedDBConnection($cn);
echo json_encode($data);
示例8: while
while ($row = Sql_fetch_array($result)) {
fwrite($file, trim(Sql_Result($row, "e_userId")) . " ");
fwrite($file, trim(Sql_Result($row, "e_password")) . " ");
fwrite($file, trim(Sql_Result($row, "e_userType")) . " ");
fwrite($file, trim(Sql_Result($row, "e_hwNo")) . " ");
fwrite($file, trim(Sql_Result($row, "e_allowedIp")) . " ");
fwrite($file, trim(Sql_Result($row, "e_allowedPort")) . " ");
fwrite($file, trim(Sql_Result($row, "e_fwdib")) . " ");
fwrite($file, trim(Sql_Result($row, "e_fwdiu")) . " ");
fwrite($file, trim(Sql_Result($row, "e_fwdina")) . " ");
fwrite($file, trim(Sql_Result($row, "e_rbtno")) . " ");
fwrite($file, trim(Sql_Result($row, "e_mcaNo")) . " ");
fwrite($file, trim(Sql_Result($row, "e_status")) . " ");
fwrite($file, trim(Sql_Result($row, "e_aaaIp")) . " ");
fwrite($file, trim(Sql_Result($row, "e_aaaPort")) . " ");
fwrite($file, trim(Sql_Result($row, "e_noOAS")) . "\n");
$is_error = 1;
}
} else {
if ($lines_count <= 1000) {
$file = fopen($file_name, "a");
fwrite($file, trim($arrayInput['basic_user_id']) . " ");
fwrite($file, trim($arrayInput['basic_pass']) . " ");
fwrite($file, trim($arrayInput['basic_user_type']) . " ");
fwrite($file, trim($arrayInput['advance_hw']) . " ");
fwrite($file, trim($arrayInput['advance_ip']) . " ");
fwrite($file, trim($arrayInput['advance_port']) . " ");
fwrite($file, trim($arrayInput['advance_busy']) . " ");
fwrite($file, trim($arrayInput['advance_unreachable']) . " ");
fwrite($file, trim($arrayInput['advance_no_ans']) . " ");
fwrite($file, trim($arrayInput['advance_rbt_no']) . " ");
示例9: while
$i = 0;
while ($row = Sql_fetch_array($result)) {
$j = 0;
$data[$i][$j++] = Sql_Result($row, "id");
$data[$i][$j++] = Sql_Result($row, "name");
$data[$i][$j++] = Sql_Result($row, "service_id");
$data[$i][$j++] = Sql_Result($row, "display_no");
$data[$i][$j++] = Sql_Result($row, "original_no");
$data[$i][$j++] = Sql_Result($row, "schedule_date");
$data[$i][$j++] = Sql_Result($row, "prompt_location");
$data[$i][$j++] = Sql_Result($row, "distribution_list");
if (Sql_Result($row, "status") == 0) {
$data[$i][$j++] = "Open";
} elseif (Sql_Result($row, "status") == 1) {
$data[$i][$j++] = "Cancelled";
} else {
$data[$i][$j++] = "Closed";
}
if (Sql_Result($row, "status") == 0) {
$data[$i][$j++] = '<span onclick="obd_execution_execute(this,' . "'" . Sql_Result($row, "id") . "'" . '); return false;"> <img style="position: relative; cursor: pointer; top: 4px" width="16" height="16" border="0" src="rcportal/img/execute.png" ></span>' . '  ' . '<span onclick="obd_execution_remove(this,' . "'" . Sql_Result($row, "id") . "'" . '); return false;"> <img style="position: relative; cursor: pointer; top: 4px" width="16" height="16" border="0" src="rcportal/img/cancel.png" ></span>';
} else {
$data[$i][$j++] = '';
}
$i++;
}
Sql_Free_Result($result);
echo json_encode($data);
} else {
echo 1;
}
ClosedDBConnection($remoteConnection);
示例10: connectDB
$cn = connectDB();
$id_1 = mysql_real_escape_string(htmlspecialchars($info['id_1']));
$id_2 = mysql_real_escape_string(htmlspecialchars($info['id_2']));
$query = "SELECT \n\t\t\t\t`rowvalue` \n\t\t FROM \n\t\t\t`tbl_audit_trail` \n\t\t WHERE (`id` = '{$id_1}' OR `id` = '{$id_2}')\n\t\t ORDER BY `action_date` Desc ";
$result = Sql_exec($cn, $query);
if (!$result) {
echo "err+" . $query . " in line " . __LINE__ . " of file" . __FILE__;
exit;
}
$data = array();
$show_response = "";
$header_date = "";
$i = 0;
$data_rows = array();
while ($row = Sql_fetch_array($result)) {
$com_str = Sql_Result($row, "rowvalue");
$str_to_json_array = json_decode($com_str, true);
ksort($str_to_json_array, SORT_NATURAL);
$str = json_encode($str_to_json_array, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
$data_rows[$i++] = $str;
}
$original = "";
$changed = "";
if (isset($data_rows[0]) && $data_rows[0] != "") {
$original = $data_rows[0];
}
if (isset($data_rows[1]) && $data_rows[1] != "") {
$changed = $data_rows[1];
}
$str_output = '<table class="table table-striped table-bordered table-hover responsive">
<thead>
示例11: Sql_fetch_array
$dt = Sql_fetch_array($res);
$dbtype = $dt['db_type'];
$Server = $dt['db_server'];
$UserID = $dt['db_user'];
$Password = $dt['db_password'];
$Database = $dt['db_name'];
ClosedDBConnection($cn);
$remoteConnection = connectDB();
$qry = "SELECT OutDialStatus, COUNT(*) as num FROM outdialque WHERE UserId='{$service_id}' GROUP BY OutDialStatus ORDER BY OutDialStatus ASC";
$result = Sql_exec($remoteConnection, $qry);
if (!$result) {
echo "err+" . $qry . " in line " . __LINE__ . " of file" . __FILE__;
exit;
}
$data = array();
$i = 0;
while ($row = Sql_fetch_array($result)) {
$j = 0;
$data[$i][$j++] = Sql_Result($row, "OutDialStatus");
$data[$i][$j++] = Sql_Result($row, "num");
if (Sql_Result($row, "OutDialStatus") == "QUE") {
$data[$i][$j++] = '<span onclick="stop_obd_operation(this,' . "'" . Sql_Result($row, "OutDialStatus") . "'" . '); return false;"> <img style="position: relative; cursor: pointer; top: 4px" width="16" height="16" border="0" src="rcportal/img/stop.png" ></span>';
} else {
$data[$i][$j++] = '<span onclick="download_obd_dashboard(this,' . "'" . Sql_Result($row, "OutDialStatus") . "'" . '); return false;"> <img style="position: relative; cursor: pointer; top: 4px" width="16" height="16" border="0" src="rcportal/img/download.png" ></span>';
}
$i++;
}
Sql_Free_Result($result);
ClosedDBConnection($remoteConnection);
echo json_encode($data);
}
示例12: mysql_real_escape_string
$slno = mysql_real_escape_string(htmlspecialchars($data['slno']));
$callId = mysql_real_escape_string(htmlspecialchars($data['callId']));
$ano = mysql_real_escape_string(htmlspecialchars($data['ano']));
$bno = mysql_real_escape_string(htmlspecialchars($data['bno']));
$call_start_time = mysql_real_escape_string(htmlspecialchars($data['call_start_time']));
$call_end_time = mysql_real_escape_string(htmlspecialchars($data['call_end_time']));
$machine_id = mysql_real_escape_string(htmlspecialchars($data['machine_id']));
$isConnected = mysql_real_escape_string(htmlspecialchars($data['isConnected']));
$cause_val = mysql_real_escape_string(htmlspecialchars($data['cause_val']));
$cost = mysql_real_escape_string(htmlspecialchars($data['cost']));
$qry = "CALL SP_CDR('" . $slno . "','" . $callId . "','" . $ano . "','" . $bno . "','" . $call_start_time . "','" . $call_end_time . "','" . $machine_id . "','" . $isConnected . "','" . $cause_val . "','" . $cost . "','" . $start_point . "','" . $per_page . "');";
$res = Sql_exec($cn, $qry);
$data_ = array();
$i = 0;
while ($row = Sql_fetch_array($res)) {
$j = 0;
$data_[$i][$j++] = Sql_Result($row, "slno");
$data_[$i][$j++] = Sql_Result($row, "callId");
$data_[$i][$j++] = Sql_Result($row, "ano");
$data_[$i][$j++] = Sql_Result($row, "bno");
$data_[$i][$j++] = Sql_Result($row, "call_start_time");
$data_[$i][$j++] = Sql_Result($row, "call_end_time");
$data_[$i][$j++] = Sql_Result($row, "machine_id");
$data_[$i][$j++] = Sql_Result($row, "isConnected");
$data_[$i][$j++] = Sql_Result($row, "cause_val");
$data_[$i][$j++] = Sql_Result($row, "cost");
$i++;
}
Sql_Free_Result($res);
echo json_encode($data_);
ClosedDBConnection($cn);
示例13: remote_connectDB
/**
* Created by PhpStorm.
* User: Talemul
* Date: 5/21/2015
* Time: 7:34 PM
*/
include_once "../lib/common.php";
$remoteCn = remote_connectDB('SMSGW');
$arrayInput = array();
$query = "SELECT \tMobileNo, MsgText, ShortCode, Keyword,SentReply, RequestDateTime\tFROM \trequestlog ";
$result = Sql_exec($remoteCn, $query);
if (!$result) {
echo "err+" . $query . " in line " . __LINE__ . " of file" . __FILE__;
exit;
}
$data = array();
$i = 0;
while ($row = Sql_fetch_array($result)) {
$j = 0;
$data[$i][$j++] = Sql_Result($row, "MobileNo");
$data[$i][$j++] = Sql_Result($row, "MsgText");
$data[$i][$j++] = Sql_Result($row, "ShortCode");
$data[$i][$j++] = Sql_Result($row, "Keyword");
$data[$i][$j++] = Sql_Result($row, "SentReply");
$data[$i][$j++] = Sql_Result($row, "RequestDateTime");
$i++;
}
Sql_Free_Result($result);
ClosedDBConnection($remoteCn);
echo json_encode($data);
示例14: connectDB
<?php
include_once "../lib/common.php";
$cn = connectDB();
$arrayInput = array();
$query = "select host_name,IP from tbl_hosts";
$result = Sql_exec($cn, $query);
if (!$result) {
echo "err+" . $query . " in line " . __LINE__ . " of file" . __FILE__;
exit;
}
$data = array();
$i = 0;
while ($row = Sql_fetch_array($result)) {
$j = 0;
$data[$i][$j++] = Sql_Result($row, "host_name");
$data[$i][$j++] = Sql_Result($row, "IP");
$data[$i][$j++] = '<span onclick="gs_delete(this,' . "'" . Sql_Result($row, "host_name") . "'" . '); return false;"> <img style="position: relative; cursor: pointer; top: 4px" width="16" height="16" border="0" src="rcportal/img/cancel.png" ></span>';
$i++;
}
Sql_Free_Result($result);
ClosedDBConnection($cn);
echo json_encode($data);
示例15: connectDB
$cn = connectDB();
$arrayInput = array();
$query = "SELECT `id`,`source_ip`,`source_port`,`source_protocol`,`destination_ip`,`destination_port`,`destination_protocol`,`route_type`,`context_name` FROM `tbl_ippbx_route` WHERE `is_active`='active'";
$result = Sql_exec($cn, $query);
if (!$result) {
echo "err+" . $query . " in line " . __LINE__ . " of file" . __FILE__;
exit;
}
$data = array();
$i = 0;
while ($row = Sql_fetch_array($result)) {
$j = 0;
$id = Sql_Result($row, "id");
$data[$i][$j++] = Sql_Result($row, "id");
$data[$i][$j++] = Sql_Result($row, "source_ip");
$data[$i][$j++] = Sql_Result($row, "source_port");
$data[$i][$j++] = Sql_Result($row, "source_protocol");
$data[$i][$j++] = Sql_Result($row, "destination_ip");
$data[$i][$j++] = Sql_Result($row, "destination_port");
$data[$i][$j++] = Sql_Result($row, "destination_protocol");
$data[$i][$j++] = Sql_Result($row, "route_type");
$data[$i][$j++] = Sql_Result($row, "context_name");
/*
$info = '' . Sql_Result($row, "id") . '|' . Sql_Result($row, "name") . '|' . Sql_Result($row, "ip_address") . '|' . Sql_Result($row, "port") . '|' . Sql_Result($row, "ep_type") . '|' . Sql_Result($row, "user_name") . '|' . Sql_Result($row, "password") . '|' . Sql_Result($row, "type") ;
*/
$data[$i][$j++] = '<span onclick="edit_input_form_route_info(this,\'' . $id . '\'); return false;"> <img style="position: relative; cursor: pointer; top: 4px" width="16" height="16" border="0" src="softswitch/img/pen.png" ></span>' . '  ' . '<span onclick="delete_route_info(this,\'' . $id . '\'); return false;"> <img style="position: relative; cursor: pointer; top: 4px" width="16" height="16" border="0" src="softswitch/img/cancel.png" ></span>';
$i++;
}
Sql_Free_Result($result);
ClosedDBConnection($cn);
echo json_encode($data);