本文整理匯總了PHP中MySQLQuery函數的典型用法代碼示例。如果您正苦於以下問題:PHP MySQLQuery函數的具體用法?PHP MySQLQuery怎麽用?PHP MySQLQuery使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MySQLQuery函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DeleteRating
function DeleteRating($ratingid)
{
$sqlstring = "delete from ratings where rating_id = '{$ratingid}'";
$result = MySQLQuery($sqlstring, __FILE__, __LINE__);
?>
<span class="message">Rating deleted</span><?php
}
示例2: GetOrderInfo
function GetOrderInfo($DBConn)
{
if (!isset($_GET['OrderID'])) {
echo "OrderID is required!";
return false;
}
$QueryString = 'select LName, FName, Address, City, State, Zip, HasMeal, BoothName, Days from orders where OrderID="' . $_GET['OrderID'] . '"';
if (isset($_GET['IncludeEvent'])) {
$QueryString = $QueryString . ' and EventID="' . $_GET['IncludeEvent'] . '"';
} elseif (isset($_GET['ExcludeEvent'])) {
$QueryString = $QueryString . ' and EventID!="' . $_GET['ExcludeEvent'] . '"';
}
$QueryString = $QueryString . ";";
$OrderQuery = MySQLQuery($DBConn, $QueryString);
if ($OrderQuery['Result'] == false) {
echo $OrderQuery['Query'];
return false;
}
if (mysqli_num_rows($OrderQuery['Query']) != 1) {
echo "No orders match that ID";
return false;
}
$Data = mysqli_fetch_assoc($OrderQuery['Query']);
return $Data;
}
示例3: GMCancelCmpst
function GMCancelCmpst($var, $gm)
{
global $tbl_sys_msg;
$gm_name = mysql_escape_string($gm);
$id = intval($var["id"]);
$qs = "update tbl_gm_compensate_action set action_state=2 where gca_uId = '{$id}' and gm = '{$gm_name}'";
$result = MySQLQuery($qs, "GMS");
$qs = "select action_id, reason, server_id from tbl_gm_compensate_action where gca_uId = '{$id}'";
$result = MySQLQuery($qs, "GMS");
$row = mysql_fetch_row($result);
$action_id = intval($row[0]);
if ($action_id < 10) {
$action_str = "000" . $action_id;
} elseif ($action_id < 100) {
$action_str = "00" . $action_id;
} elseif ($action_id < 1000) {
$action_str = "0" . $action_id;
}
if (LogGMCommand($gm_name, $var["action_name"] . "." . $action_str, $row[1], $row[2])) {
PrintNotice($tbl_sys_msg["success"]);
BackAndRefresh($tbl_sys_msg["success"]);
return true;
}
return false;
}
示例4: RoleToUser
function RoleToUser($var, $gm)
{
global $page_main;
if ($var["serverindex"] == null || $var["serverindex"] == "") {
echo "<script src='/js/checkbox.js' type='text/javascript'></script>\n";
form($var, $gm);
checkbox(true, false);
echo "</form>\n";
ReturnAndBack();
$ret = eachServerFrame($var, $gm);
ReturnAndBack();
return $ret;
}
$serverid = $var["serverindex"];
$role_names = $var["role_name"];
$role_names = implode("','", explode(",", $role_names));
$qs = "select distinct us.us_uId, us.us_sName from tbl_char_static cs, tbl_char c, tbl_user_static us where cs.cs_uId = c.cs_uId and cs.us_uId = us.us_uId and c.c_sName in ('" . $role_names . "');";
$result = MySQLQuery($qs, "Game", $serverid);
echo "<table class='list_table'>\n";
echo "<tr><th>" . $page_main["user_id"] . "</th><th>" . $page_main["user_name"] . "</th></tr>\n";
while ($row = mysql_fetch_row($result)) {
printf("<tr" . ($i++ % 2 == 0 ? "" : " class='even'") . "><td>%s</td><td><input type='checkbox' flag='user' onclick='Checkbox(this);' value='%s'/>%s</td></tr>\n", $row[0], $row[1], $row[1]);
}
echo "</table>\n";
return true;
}
示例5: GetGMMgrInfo
function GetGMMgrInfo($var, $gm)
{
if ($var["serverindex"] == null || $var["serverindex"] == "") {
$js_src = <<<_js_src
<script type="text/javascript">
<!--//
function DelGMMmr(obj,id,game_id)
{
\tdocument.form1.action = "/cgi-bin/gm_tools/FrameWork.php";
\tdocument.form1.action_name.value = '89';
\tdocument.form1.target = "block";
\tdocument.form1.id.value = id;
\tdocument.form1.game_id.value = game_id;
\tdocument.form1.serverid.value = \$(obj).parents(".panel").attr("id").substring(4);
\tdocument.form1.submit();
}
function ChangeGMLevel(obj,id,game_id)
{\t
\tdocument.form1.action = "/lib/gm_tools/ChangeGMLevel.php";
\tdocument.form1.target = "block";
\tdocument.form1.id.value = id;
\tdocument.form1.game_id.value = game_id;
\tdocument.form1.serverid.value = \$(obj).parents(".panel").attr("id").substring(4);
\tdocument.form1.submit();
\t
}
</script>
_js_src;
echo $js_src . "\n";
form($var, $gm);
echo "<input type='hidden' name='id'/>\n";
echo "<input type='hidden' name='game_id'/>\n";
$ret = eachServerFrame($var, $gm);
echo "</form>\n";
ReturnAndBack();
return $ret;
} else {
$serverid = intval($var["serverindex"]);
}
global $page_main, $tbl_sys_msg;
$query_string = "select username,gv_uLevel, us_uGameID from tbl_gm_validate";
$result = MySQLQuery($query_string, "Game", $serverid);
echo "<table class='list_table'>\n";
printf("<tr><th>%s</th><th>%s</th><th>%s</th></tr>\n", $page_main["user_name"], $tbl_sys_msg["level"], $tbl_sys_msg["act"]);
while ($row = mysql_fetch_row($result)) {
$func_str = "";
if (hasAuth(89, $gm)) {
$func_str .= sprintf("<input type=button value=\"%s\" onclick=\"DelGMMmr(this,'%s',%d)\"/>", $tbl_sys_msg["delete"], $row[0], $row[2]);
}
if (hasAuth(96, $gm)) {
$func_str .= sprintf("<input type=button value=\"%s\" onclick=\"ChangeGMLevel(this,'%s',%d)\"/>", $tbl_sys_msg["edit"], $row[0], $row[2]);
}
printf("<tr" . ($i % 2 == 0 ? "" : " class='even'") . "><td>%s</td><td>%d</td><td>%s</td></tr>\n", $row[0], $row[1], $func_str);
}
echo "</table>\n";
return true;
}
示例6: SwitchInstance
function SwitchInstance($id)
{
$sqlstring = "select instance_name from instance where instance_id = {$id}";
$result = MySQLQuery($sqlstring, __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$instancename = $row['instance_name'];
$_SESSION['instanceid'] = $id;
$_SESSION['instancename'] = $instancename;
//echo "Switched instance to $id";
}
示例7: GetFriends
function GetFriends($var, $gm)
{
global $tbl_role_all_detail;
echo "<h1>{$tbl_role_all_detail['16']}</h1>\n";
ReturnAndBack();
Reload();
$role_id = ArgRoleId();
echo "<table class='list_table'>\n";
echo sprintf("<tr><td>{$tbl_role_all_detail['18']}</td></tr>\n", ArgRoleName() . "(" . $role_id . ")");
echo "</table>\n";
global $tbl_role_friends, $tbl_camp, $tbl_class, $tbl_sex, $tbl_sys_msg;
$serverid = $var["serverid"];
if (!$role_id) {
return true;
}
echo "<h1>" . $tbl_role_friends[0] . "</h1>\n";
echo "<table class='list_table'>\n";
printf("<tr><th>%s</th><th>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th></tr>\n", $tbl_role_friends[1][0], $tbl_role_friends[1][1], $tbl_role_friends[1][2], $tbl_role_friends[1][3], $tbl_role_friends[1][4], $tbl_role_friends[1][5]);
$rs = MySQLQuery("select c.c_sName, cs.cs_uCamp, cs.cs_uClass, cb.cb_uLevel, cs.cs_uSex, fc.fc_sName from tbl_player_friends pf, tbl_friends_class fc, tbl_char c, tbl_char_basic cb, tbl_char_static cs where pf.fc_uId = fc.fc_uId and pf.cs_uId = fc.cs_uId and pf.pf_uFriendId = c.cs_uId and fc.fc_uId<>2 and pf.cs_uId='{$role_id}' and cb.cs_uId = c.cs_uId and cs.cs_uId = c.cs_uId", "Game", $serverid);
while ($row = mysql_fetch_row($rs)) {
if ($row[5] == UTF82Local($tbl_role_friends[1][6])) {
$row[5] = $tbl_role_friends[1][6];
}
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $row[5], $row[0], $tbl_camp[$row[1]], $tbl_class[$row[2]], $row[3], $tbl_sex[$row[4]]);
}
echo "</table>\n";
echo "<h1>" . $tbl_role_friends[2] . "</h1>\n";
echo "<table class='list_table'>\n";
printf("<tr><th>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th></tr>\n", $tbl_role_friends[3][0], $tbl_role_friends[3][1], $tbl_role_friends[3][2], $tbl_role_friends[3][3], $tbl_role_friends[3][4]);
$rs = MySQLQuery("select c.c_sName, cs.cs_uCamp, cs.cs_uClass, cb.cb_uLevel, cs.cs_uSex from tbl_player_friends pf, tbl_char c, tbl_char_basic cb, tbl_char_static cs where pf.pf_uFriendId = c.cs_uId and pf.cs_uId='{$role_id}' and pf.fc_uId=2 and cb.cs_uId = c.cs_uId and cs.cs_uId = c.cs_uId", "Game", $serverid);
while ($row = mysql_fetch_row($rs)) {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $row[0], $tbl_camp[$row[1]], $tbl_class[$row[2]], $row[3], $tbl_sex[$row[4]]);
}
echo "</table>\n";
echo "<h1>" . $tbl_role_friends[4] . "</h1>\n";
echo "<table class='list_table'>\n";
printf("<tr><th>%s</th><th>%s</th><th>%s</th></tr>\n", $tbl_role_friends[5][0], $tbl_role_friends[5][1], $tbl_role_friends[5][2]);
$rs = MySQLQuery("select fg.fg_sName,gm1.gm_uIdentity,count(*) from tbl_group_manager gm1,tbl_group_manager gm2,tbl_friends_group fg where gm1.cs_uId='{$role_id}' and gm1.fg_uId = gm2.fg_uId and gm1.fg_uId = fg.fg_uId group by gm2.fg_uId", "Game", $serverid);
while ($row = mysql_fetch_row($rs)) {
printf("<tr><td>%s</td><td>%s</td><td>%d</td></tr>\n", $row[0], $tbl_role_friends[5][3][intval($row[1])], $row[2]);
}
echo "</table>\n";
echo "<h1>" . $tbl_role_friends[6] . "</h1>\n";
echo "<table class='list_table'>\n";
printf("<tr><th>%s</th><th>%s</th><th>%s</th></tr>\n", $tbl_role_friends[7][0], $tbl_role_friends[7][1], $tbl_role_friends[7][2]);
$rs = MySQLQuery("select t.t_sName, mt1.mt_sPosition, count(*) from tbl_member_tong mt1, tbl_tong t, tbl_member_tong mt2 where mt1.t_uId = t.t_uId and t.t_uId = mt2.t_uId and mt1.cs_uId = '{$role_id}' group by t.t_uId", "Game", $serverid);
while ($row = mysql_fetch_row($rs)) {
global $tbl_tong_pos;
printf("<tr><td>%s</td><td>%s</td><td>%d</td></tr>\n", $row[0], $tbl_tong_pos[intval($row[1])], $row[2]);
}
echo "</table>\n";
return true;
}
示例8: GetModalityList
function GetModalityList($withdesc = false)
{
$sqlstring = "select * from modalities order by mod_desc";
$result = MySQLQuery($sqlstring, __FILE__, __LINE__);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$modalities[] = $row['mod_code'];
$descriptions[] = $row['mod_code'];
}
if ($withdesc) {
return array($modalities, $descriptions);
} else {
return $modalities;
}
}
示例9: GetTongDetail
function GetTongDetail($var, $gm)
{
$id = intval($var["id"]);
$serverid = intval($var["serverid"]);
$query_string = "select t_sName, c.c_sName, t_uCamp, t.t_uId, t_dtCreateTime, t_uHonor, t_uLevel, t_uMoney, t_uResource, t_sPurpose, t_uDepotId, count(mt.cs_uId), ifnull(wz_uId, 0), ifnull(wz.wzs_uIndex, 0) from tbl_tong t left join tbl_war_zone_station wz on t.t_uId = wz.t_uId, tbl_member_tong mt, tbl_member_tong o, tbl_char c where o.t_uId=t.t_uId and o.mt_sPosition=5 and o.cs_uId=c.cs_uId and t.t_uId=mt.t_uId and t.t_uId='{$id}' group by t.t_uId";
$result = MySQLQuery($query_string, "Game", $serverid);
$tbl_content = array();
while ($row = mysql_fetch_row($result)) {
$tbl_size = count($tbl_content);
$tbl_content[$tbl_size] = $row;
}
RetTongDetail($tbl_content[0], $var);
return true;
}
示例10: SendEmail
function SendEmail($emailbody, $emailsubject, $emailto)
{
$sqlstring = "select user_email from users where user_email <> ''";
$result = MySQLQuery($sqlstring, __FILE__, __LINE__);
$numrows = mysql_num_rows($result);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$emailto = $row['user_email'];
/* send the email */
if (!SendGmail($emailto, $emailsubject, $emailbody, 1, 0)) {
return "System error. Unable to send email!";
} else {
return "Message send successfully to {$numrows} recipients";
}
}
}
示例11: Main
function Main()
{
$now = Date("Y-m-d H:i:s");
P($now . "==============================\n");
global $tbl_gm_db, $tbl_serv_db, $tbl_game_server;
$str = "(";
$qs = "select * from tbl_channel_word";
$result = MySQLQuery($qs, "GMS");
$words = array();
while ($row = mysql_fetch_row($result)) {
array_push($words, "lcc.lcc_sMsg like '%" . $row[0] . "%'");
}
$str .= implode(" or ", $words);
$str .= ")";
P("Number of Check Word: " . count($words) . "\n");
$qs = "select gv_value from tbl_gm_variable where gv_name = 'ChannelChatStemp'";
$result = MySQLQuery($qs, "GMS");
if ($row = mysql_fetch_row($result)) {
P("Last updated at: " . $row[0] . "\n");
$str .= " and lcc.lcc_dtChatTime > '" . $row[0] . "' and lcc.lcc_dtChatTime <= '" . $now . "'";
}
$qs = "update tbl_gm_variable set gv_value = '" . $now . "' where gv_name = 'ChannelChatStemp'";
MySQLQuery($qs, "GMS");
foreach ($tbl_serv_db as $key => $dbinfo) {
P("Server: " . $key . "\t");
$insert = array();
$qs = "select lcc.cs_uId,lcc.lcc_dtChatTime,{$key} as serv_id,lcc.lcc_sMsg,lcc.lcc_sChannelName from tbl_log_channel_chat lcc where " . $str;
$result = MySQLQuery($qs, "GameLog", $key);
while ($row = mysql_fetch_row($result)) {
$qs = "select c.c_sName, us.us_sName from tbl_char c, tbl_char_static cs, tbl_user_static us where c.cs_uId = cs.cs_uId and cs.us_uId = us.us_uId and cs.cs_uId = " . $row[0];
$rs = MySQLQuery($qs, "Game", $key);
if ($r = mysql_fetch_row($rs)) {
$row[0] = $r[0];
$user_name = $r[1];
} else {
$row[0] = "[" . $row[0] . "]";
}
array_push($insert, "insert into tbl_channel_chat values('" . $row[0] . "','" . $row[3] . "','" . $row[1] . "','" . Local2UTF8($row[4]) . "'," . $row[2] . ",'" . $user_name . "')");
}
P("Number of Chat: " . count($insert) . "\n");
foreach ($insert as $query) {
MySQLQuery($query, "GMS");
}
}
}
示例12: ViewDetails
function ViewDetails($requestid) {
$sqlstring = "select * from data_requests where request_id = $requestid";
$result = MySQLQuery($sqlstring,__FILE__,__LINE__);
$fields_num = mysql_num_fields($result);
for($i=0; $i<$fields_num; $i++)
{
$field = mysql_fetch_field($result);
$fields[] = $field->name;
}
?><div style="column-count 3; -moz-column-count:3; -webkit-column-count:3"><?
$row = mysql_fetch_array($result, MYSQL_ASSOC);
foreach ($fields as $f) {
if (($f != 'req_results') && (stripos($f,'password') === false)) {
echo "<b>$f</b> - " . $row[$f] . "<br>";
}
}
echo "</div><pre><b>Request results</b><br>" . $row['req_results'] . "</pre>";
}
示例13: SearchTaskInfo
function SearchTaskInfo($var, $gm)
{
global $tbl_list_task;
$serverid = $var["serverid"];
$role_id = ArgRoleId();
if (!$role_id) {
return true;
}
$query_string = "select q_sName,q_state,FROM_UNIXTIME(q_tAcceptTime),FROM_UNIXTIME(q_tFinishTime) from tbl_quest where cs_uId=" . $role_id . " and q_sName = '" . UTF82Local($var["quest_name"]) . "'";
$result = MySQLQuery($query_string . " order by q_tAcceptTime", "Game", $serverid);
$tbl_content = array();
while ($row = mysql_fetch_row($result)) {
$row[1] = $tbl_list_task[intval($row[1])];
$tbl_size = count($tbl_content);
$tbl_content[$tbl_size] = $row;
}
if (!IsDownload($var)) {
RetGetTaskInfo($tbl_content, $role_name, $role_id);
return true;
}
return true;
}
示例14: GetMoneyCorrencyLimit
function GetMoneyCorrencyLimit($var, $gm)
{
if ($var["serverindex"] == null || $var["serverindex"] == "") {
$js_src = <<<_js_src
<script type="text/javascript">
<!--//
function DelMoneyCorrencyLimit(money_func,obj)
{
\tdocument.form1.target = "block";
\tdocument.form1.action_name.value = '93';
\tdocument.form1.money_func.value = money_func;
\tdocument.form1.serverid.value = \$(obj).parents(".panel").attr("id").substring(4);
\tdocument.form1.submit();
}
</script>
_js_src;
echo $js_src;
form($var, $gm);
echo "<input type='hidden' name='money_func'/>\n";
echo "</form>\n";
$ret = eachServerFrame($var, $gm);
ReturnAndBack();
return $ret;
} else {
$serverid = intval($var["serverindex"]);
}
$query_string = "select mcl_sFunName,mcl_sModule from tbl_money_corrency_limit";
$result = MySQLQuery($query_string, "Game", $serverid);
$tbl_content = array();
while ($row = mysql_fetch_row($result)) {
$tbl_size = count($tbl_content);
$tbl_content[$tbl_size] = $row;
}
RetMoneyCorrencyLimit($tbl_content, $var);
return true;
}
示例15: ViewReport
function ViewReport($datestart, $dateend, $modality, $studysite) {
if ($modality == "") {
$sqlstring = "select c.uid, c.subject_id, c.gender, c.birthdate, d.*, a.* from studies a left join enrollment b on a.enrollment_id = b.enrollment_id left join subjects c on b.subject_id = c.subject_id left join projects d on b.project_id = d.project_id where a.study_datetime > '$datestart' and a.study_datetime < '$dateend' and a.study_site = '$studysite' order by study_datetime";
}
else {
$sqlstring = "select c.uid, c.subject_id, c.gender, c.birthdate, d.*, a.* from studies a left join enrollment b on a.enrollment_id = b.enrollment_id left join subjects c on b.subject_id = c.subject_id left join projects d on b.project_id = d.project_id where a.study_modality = '$modality' and a.study_datetime > '$datestart' and a.study_datetime < '$dateend' order by study_datetime";
}
//echo $sqlstring;
?>
<b>Imaging studies from <?php
echo $datestart;
?>
to <?php
echo $dateend;
?>
</b>
<br>
<br>
<table class="graydisplaytable">
<tr>
<th>UID</th>
<th>Study</th>
<th>Sex</th>
<th>BirthDate</th>
<th>Study Description</th>
<th>Project</th>
<th>Study date</th>
<th>Radiological Read?</th>
<th>Read date</th>
<th>Read findings</th>
</tr>
<?
$result = MySQLQuery($sqlstring, __FILE__, __LINE__);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$uid = $row['uid'];
$gender = $row['gender'];
$subjectid = $row['subject_id'];
$subjectdob = $row['birthdate'];
$studyid = $row['study_id'];
$studynum = $row['study_num'];
$studydesc = $row['study_desc'];
$studydatetime = $row['study_datetime'];
$studyradreaddone = $row['study_doradread'];
$studyradreaddate = $row['study_radreaddate'];
$studyradreadfindings = $row['studyradreadfindings'];
$project = $row['project_name'] . " (" . $row['project_costcenter'] . ")";
?>
<tr>
<td><a href="subjects.php?id=<?php
echo $subjectid;
?>
"><?php
echo $uid;
?>
</a></td>
<td><a href="studies.php?id=<?php
echo $studyid;
?>
"><?php
echo $uid;
echo $studynum;
?>
</a></td>
<td><?php
echo $gender;
?>
</td>
<td><?php
echo $subjectdob;
?>
</td>
<td><?php
echo $studydesc;
?>
</td>
<td><?php
echo $project;
?>
</td>
<td><?php
echo $studydatetime;
?>
</td>
<td><?php
echo $studyradreaddone;
?>
</td>
<td><?php
echo $studyradreaddate;
?>
</td>
<td><?php
echo $studyradreadfindings;
?>
</td>
</tr>
<?
}
?>
</table>
//.........這裏部分代碼省略.........