本文整理汇总了PHP中mysql_Query函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql_Query函数的具体用法?PHP mysql_Query怎么用?PHP mysql_Query使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql_Query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_page_content
function display_page_content()
{
$item_id = requestIdParam();
$query = "SELECT thumbnail FROM items \n\t WHERE id = {$item_id}";
$result = mysql_Query($query, MyActiveRecord::Connection());
$data = @mysql_fetch_array($result);
if (!empty($data["thumbnail"])) {
// Output the MIME header
header("Content-Type: image/jpeg");
// Output the image
echo $data["thumbnail"];
}
}
示例2: display_page_content
function display_page_content()
{
$connection = MyActiveRecord::Connection();
$imageId = mysql_real_escape_string(requestIdParam());
// TODO: use a parameterized query instead of an escaped string
$query = "SELECT * FROM images WHERE id = {$imageId}";
$result = mysql_Query($query, $connection);
$data = @mysql_fetch_array($result);
if (!empty($data["original"])) {
// Output the MIME header
header("Content-Type: {$data['mime_type']}");
set_image_cache_headers("img_" . $imageId);
// Output the image
echo $data["original"];
}
}
示例3: mysql_Query
$wearable = 0;
}
if ($db['bs'] == 0 && $dat["bs"] == 1) {
$wearable = 0;
}
if ($db['bs'] == 1 && $dat["bs"] == 0) {
$wearable = 0;
}
if ($dat["object_type"] == 'kostyl') {
$wearable = 1;
}
if ($dat["need_orden"] != 0 && $db["orden"] != $dat["need_orden"]) {
$wearable = 0;
}
if ($dat["term"] != "") {
mysql_Query("DELETE FROM inv WHERE id=" . $dat["id"] . " and term<" . time());
if (mysql_affected_rows() > 0) {
$_SESSION["message"] = "Закончился срок аренды <b>" . $dat["name"] . "</b>";
history($login, "Закончился срок аренды", $dat["name"], $db["remote_ip"], "Инвентарь");
Header("Location: inv.php?otdel=obj&tmp=" . md5(time()));
}
}
$desc = "";
if ($dat["art"] == 1) {
$desc .= "<img src='http://www.meydan.az/img/artefakt.gif' border='0' /> ";
}
if ($dat["art"] == 2) {
$desc .= "<img src='http://www.meydan.az/img/icon/artefakt.gif' border='0' /> ";
}
if ($dat["podzemka"]) {
$desc .= "<img src='http://www.meydan.az/img/icon/podzemka.gif' border='0' /> ";
示例4: Upload_and_Save_Image
function Upload_and_Save_Image($image, $table_name, $file_field_name, $row_id, $thiswidth = null, $thisheight = null)
{
$mimeType = $image["type"];
switch ($mimeType) {
case "image/gif":
$mimeName = "GIF Image";
break;
case "image/jpeg":
$mimeName = "JPEG Image";
break;
case "image/png":
$mimeName = "PNG Image";
break;
case "image/x-MS-bmp":
$mimeName = "Windows Bitmap";
break;
default:
$mimeName = "Unknown image type";
}
$filetype = getFileExtension($image["name"]);
list($width) = getimagesize($image["tmp_name"]);
$max_width = defined($thiswidth) ? $thiswidth : 0;
$max_height = defined($thisheight) ? $thisheight : 0;
resizeImageToMax($image["tmp_name"], $max_width, $max_height, $filetype);
// Open the uploaded file
$file = fopen($image["tmp_name"], "r");
// Read in the uploaded file
$fileContents = fread($file, filesize($image["tmp_name"]));
// Escape special characters in the file
$fileContents = AddSlashes($fileContents);
$updateQuery = 'UPDATE ' . $table_name . ' SET ' . $file_field_name . ' = "' . $fileContents . '", mime_type = "' . $mimeType . '" WHERE id = ' . $row_id . ';';
$result = mysql_Query($updateQuery, MyActiveRecord::Connection());
if (!$result) {
echo 'Invalid query: ' . mysql_error();
}
}
示例5: date
}
if ($total < $start + $ttt) {
$end = $total;
} else {
$end = $start + $ttt;
}
for ($i = 0; $i < $total; $i++) {
$classdate = "date";
#$time =date("d.m.y H:i",$chat_array[$i][1]);
$time = date("H:i", $chat_array[$i][1]);
$name = $chat_array[$i][2];
$color = $chat_array[$i][3];
$body = $chat_array[$i][4];
$msg_room = $chat_array[$i][5];
$msg_city = $chat_array[$i][6];
$have_ignor = mysql_fetch_Array(mysql_Query("SELECT count(*) FROM ignor WHERE login='" . $login . "' and ignored='" . $name . "'"));
if (eregi("to \\[{$login}\\]", $body, $regs)) {
$classdate = "date2";
$forom = 1;
}
if (eregi("private \\[{$login}\\]", $body, $regs)) {
$classdate = "date2";
}
if (eregi("clan \\[{$my_clan}\\]", $body, $regs)) {
$classdate = "date2";
}
if (substr($body, 0, 7) == "private") {
if (eregi("private \\[{$login}\\]", $body, $regs)) {
if (!$have_ignor[0]) {
$massages .= "<font class='{$classdate}'>{$time}</font> [<a href='?who={$name}'>{$name}</a>] <font color='{$color}'>{$body}</font> <br/>";
}
示例6: switch
} else {
if ($my_money < $price_gos) {
$mess = "У вас нет такой суммы!";
} else {
switch ($present_who) {
case 1:
$present_who = $login;
break;
case 2:
$present_who = "Клан " . $db["clan"];
break;
}
mysql_query("LOCK TABLES inv WRITE");
mysql_query("INSERT INTO inv(owner,object_id,object_type,object_razdel,term,msg,gift,gift_author,wear) VALUES ('" . $pr_user["login"] . "','" . $item . "','flower','other','" . $term . "','" . $present_text . "','1','" . $present_who . "','0')");
mysql_query("UNLOCK TABLES");
mysql_Query("UPDATE flower SET mountown=mountown-1 WHERE id=" . $item);
if ($is_art) {
mysql_query("UPDATE users SET platina=platina-{$price} WHERE login='" . $login . "'");
$db["platina"] = $db["platina"] - $price;
} else {
mysql_query("UPDATE users SET money=money-{$price} WHERE login='" . $login . "'");
$db["money"] = $db["money"] - $price;
}
if ($pr_user["id"] != $db["id"]) {
mysql_query("UPDATE daily_kwest SET taked=taked+1 WHERE user_id='" . $db['id'] . "' and kwest_id=5");
//daily kwest
}
$name = $DATA["name"];
$mess = "Вы удачно купили «{$name}» за {$price} {$money_type}.";
$name2 = "{$name} ({$price} {$money_type}), От имени: <b>{$present_who}</b>, С пожеланием: <b>{$present_text}</b>";
$name3 = "{$name} ({$price} {$money_type}), От имени: <b>{$login}</b>, С пожеланием: <b>{$present_text}</b>";
示例7: lose
function lose($team, $battle, $phrase)
{
$date = date("H:i");
$sql_bat = mysql_query("SELECT zayavka.type,battles.creator_id FROM `battles` LEFT JOIN zayavka on zayavka.creator=battles.creator_id WHERE battles.id={$battle}");
$B_DAT = mysql_fetch_array($sql_bat);
mysql_free_result($sql_bat);
$cr = $B_DAT["creator_id"];
$zay_type = $B_DAT["type"];
$boylar = array(3, 4, 101, 5, 6, 102, 11);
$T = mysql_query("SELECT player,hitted FROM teams WHERE battle_id='" . $cr . "' AND over=0 and team='" . $team . "'");
while ($DATA = mysql_fetch_array($T)) {
$player = $DATA["player"];
$hitted_win = $DATA["hitted"];
if ($zay_type == 15) {
mysql_query('UPDATE labirint SET location="29x15", vector="180" WHERE user_id="' . $player . '"');
}
if ($zay_type == 88) {
mysql_query('UPDATE labirint SET location="29x2", vector="180", lose=lose+1 WHERE user_id="' . $player . '"');
}
if ($zay_type == 89) {
mysql_query('UPDATE labirint SET lose=lose+1 WHERE user_id="' . $player . '"');
}
//-------------------------------------------------------------------------------------
$LOSER_QUERY_D = mysql_query("SELECT users.*,zver.energy FROM users LEFT join zver on zver.owner=users.id and zver.sleep=0 WHERE login='" . $player . "'");
$LOSER_DATA = mysql_fetch_array($LOSER_QUERY_D);
mysql_free_result($LOSER_QUERY_D);
$objects = array();
$objects[0] = $LOSER_DATA["amulet"];
$objects[1] = $LOSER_DATA["hand_r"];
$objects[2] = $LOSER_DATA["armour"];
$objects[3] = $LOSER_DATA["poyas"];
$objects[4] = $LOSER_DATA["ring1"];
$objects[5] = $LOSER_DATA["ring2"];
$objects[6] = $LOSER_DATA["ring3"];
$objects[7] = $LOSER_DATA["helmet"];
$objects[8] = $LOSER_DATA["perchi"];
$objects[9] = $LOSER_DATA["hand_l"];
$objects[10] = $LOSER_DATA["boots"];
$objects[11] = $LOSER_DATA["naruchi"];
$objects[12] = $LOSER_DATA["rubaxa"];
$objects[13] = $LOSER_DATA["plash"];
$objects[14] = $LOSER_DATA["mask"];
$objects[15] = $LOSER_DATA["pants"];
$objects[16] = $LOSER_DATA["masdrikon"];
$objects[17] = $LOSER_DATA["rukavic"];
$damage = 0;
shuffle($objects);
foreach ($objects as $key => $value) {
if ($value == 0) {
unset($objects[$key]);
}
}
$new_array = array_values($objects);
$damage = $new_array[0];
if ($damage != 0) {
$GET_F_INV = mysql_query("SELECT paltar.name,inv.iznos_max,inv.iznos FROM inv LEFT JOIN paltar on paltar.id=inv.object_id WHERE inv.id=" . $damage);
$GET_D = mysql_fetch_array($GET_F_INV);
mysql_free_result($GET_F_INV);
$iznos_all = $GET_D["iznos_max"];
$iznos = $GET_D["iznos"] + 1;
$obj_name = $GET_D["name"];
$krit_iznos = $iznos_all - 2;
if ($iznos >= $krit_iznos && $iznos < $iznos_all) {
talk($player, "Предмет <b>" . $obj_name . "</b> в критическом состоянии!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA);
}
if ($iznos <= $iznos_all) {
mysql_query("UPDATE inv SET iznos =iznos+1 WHERE id = '" . $damage . "'");
}
if ($iznos_all == 1) {
unWear($player, $damage);
mysql_query("DELETE FROM inv WHERE id='" . $damage . "'");
history($player, 'Пришел в негодность', $obj_name, $LOSER_DATA["remote_ip"], "Бой " . $battle);
talk($player, "Предмет <b>" . $obj_name . "</b> сломался", $LOSER_DATA);
} else {
if ($iznos == $iznos_all) {
unWear($player, $damage);
talk($player, "Предмет <b>" . $obj_name . "</b> нуждается в ремонте!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA);
}
}
}
if ($zay_type == 29) {
#Пещера Воинов
mysql_query("UPDATE users SET zayava=0 WHERE login='" . $player . "'");
mysql_query("UPDATE war_team SET lose=1 WHERE player='" . $player . "'");
say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player);
}
if ($zay_type == 99 || $zay_type == 66) {
mysql_query("UPDATE users SET bs=0,location='', vector='' WHERE login='" . $player . "'");
$str = "<span class=date>" . date("d.m.y H:i") . "</span> <script>drwfl('" . $LOSER_DATA['login'] . "','" . $LOSER_DATA['id'] . "','" . $LOSER_DATA['level'] . "','" . $LOSER_DATA['dealer'] . "','" . $LOSER_DATA['orden'] . "','" . $LOSER_DATA['admin_level'] . "','" . $LOSER_DATA['clan_short'] . "','" . $LOSER_DATA['clan'] . "');</script> повержен и выбывает из турнира<BR>";
mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,"' . $str . '") WHERE `active` = TRUE');
mysql_Query("DELETE FROM labirint WHERE user_id='" . $player . "'");
mysql_Query("UPDATE bs_objects SET bs=0,owner='',coord='" . $LOSER_DATA["location"] . "' WHERE owner='" . $player . "'");
mysql_query("DELETE FROM inv WHERE owner='" . $player . "' and object_razdel='thing' and object_id=24 LIMIT 1");
say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player);
}
if ($zay_type == 19) {
//Таинственный Маяк
$have_hell = mysql_fetch_Array(mysql_Query("SELECT * FROM hellround_pohod WHERE `end` = 0 and `owner`=" . $LOSER_DATA["id"] . ";"));
$count_wood = $have_hell["volna"];
for ($i = 0; $i < $count_wood; $i++) {
//.........这里部分代码省略.........
示例8: mysql_fetch_Array
echo "OK";
} else {
echo "NO USERS";
}
}
}
if ($_POST["heal"]) {
$query = mysql_fetch_Array(mysql_query("SELECT * FROM zayavka WHERE type=23"));
if ($query) {
$res = mysql_fetch_array(mysql_Query("SELECT * FROM battles WHERE creator_id=" . $query["creator"]));
$have_bot = mysql_fetch_array(mysql_Query("SELECT * FROM bot_temp WHERE battle_id=" . $res["id"] . " and team=2"));
$hp_add = 50000;
$new_hp = $have_bot["hp"] + $hp_add;
if ($new_hp > $have_bot["hp_all"]) {
$new_hp = $have_bot["hp_all"];
$hp_add = $have_bot["hp_all"] - $have_bot["hp"];
}
mysql_Query("UPDATE bot_temp SET hp=hp+{$hp_add} WHERE id=" . $have_bot["id"]);
$phrase_priem = "<span class=date>" . date("H:i") . "</span> <b>Исчадие Хаоса</b> понял что его спасение это прием <b>Воля к победе. <font color=green>+{$hp_add}</font></b> [" . $new_hp . "/" . $have_bot['hp_all'] . "]<br>";
battle_log($res["id"], $phrase_priem);
} else {
echo "You Should Start Battle";
}
}
?>
<form method="POST" action="?spell=chaos_battle">
Битва с Исчадием Хаоса <input type="submit" name="startBattle" value="Start Battle"><BR>
Heal HP <input type="submit" name="heal" value="OK"><BR>
</form>
<?php
}
示例9: array
$svet_Array = array(1, 4, 3);
$tma_Array = array(2, 3);
$join_team = (int) $_GET["team"];
$have_i = mysql_fetch_Array(mysql_Query("SELECT * FROM war_team WHERE player='" . $login . "'"));
if (!$have_i) {
$count_Teams = mysql_fetch_Array(mysql_query("SELECT count(*) FROM war_team WHERE team={$join_team}"));
if ($count_Teams[0] < 20) {
if ($join_team == 1 && in_Array($db["orden"], $svet_Array) || $join_team == 2 && in_Array($db["orden"], $tma_Array)) {
mysql_query("INSERT INTO war_team VALUES('" . $login . "','" . $have_Zayavka['id'] . "','" . $join_team . "','0')");
mysql_query("UPDATE users SET zayava=1 WHERE login='" . $login . "'");
if ($join_team == 1) {
$loc = "32x5";
} else {
$loc = "2x24";
}
mysql_Query("DELETE FROM labirint WHERE user_id='" . $login . "'");
mysql_query("INSERT INTO labirint(user_id, location, vector, visit_time) VALUES('" . $login . "', '" . $loc . "', '0', '" . time() . "')");
$msg = "Заявка на бой подана";
} else {
$msg = "Вы не можете идти на поединок против своих...";
}
} else {
$msg = "Максимальное колличество бойцов в группе - 20 чел.";
}
} else {
$msg = "Вы уже и так в группе";
}
}
#######################################################
echo "\n\t\t\t\t\t<font color='#ff0000'>{$msg}</font><br>\n\t\t\t\t\t<table cellspacing=1 cellpadding=3 align=center width=600>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=2 align=center><b>До войны еще: " . convert_time($have_Zayavka['start_time']) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='newbut' align=center>\n\t\t\t\t\t\t\t<td width=50%><b>Свет</td><td><b>Тьма</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=top>";
$sql_team1 = mysql_query("SELECT users.login, users.level, users.id, users.orden, users.admin_level, users.clan, users.clan_short, users.dealer FROM war_team LEFT JOIN users ON users.login=war_team.player WHERE group_id=" . $have_Zayavka['id'] . " and war_team.team=1");
示例10: updateOrderInSection
function updateOrderInSection($section, $order = 1)
{
if ($section != null) {
$updateQuery = "UPDATE items_sections SET display_order = " . $order . " WHERE items_id = " . $this->id . " AND sections_id = " . $section->id;
$result = mysql_Query($updateQuery, MyActiveRecord::Connection()) or die("Error updating item order in section: " . $updateQuery);
}
}
示例11: next_step
if ($_GET['action'] == 'rotateright') {
$my_vector += 90;
if ($my_vector > 270) {
$my_vector = 0;
}
} else {
if ($_GET['action'] == 'forward') {
$step1 = next_step($my_cord, $my_vector);
if ($step1['fwd'] && !in_array($step1["fwd"], $sunduk_Array) && !count($Bot_Array[$step1['fwd']])) {
if ($step1['fwd'] == "4x3" && $my_vector == 180) {
$have_opened = mysql_fetch_array(mysql_query("SELECT * FROM led_setting WHERE group_id='" . $group_id . "' and type='key' and etaj={$etaj}"));
if (!$have_opened) {
$have_key = mysql_fetch_array(mysql_query("SELECT id FROM inv WHERE object_type='wood' and inv.owner='" . $login . "' and object_id=25"));
if ($have_key) {
mysql_query("INSERT INTO led_setting VALUES (0,'" . $step1['fwd'] . "','" . $login . "','" . $group_id . "','{$etaj}','key','')");
mysql_Query("DELETE FROM inv WHERE id=" . $have_key["id"]);
say("toroom", "<b>" . $logins . "</b> открыл <b>«Решётку»</b>", $login);
$my_cord = $step1['fwd'];
$Time = $ctime;
} else {
$msg = "Не хватает: Ключ от Лабиринта";
}
} else {
$my_cord = $step1['fwd'];
$Time = $ctime;
}
} else {
$my_cord = $step1['fwd'];
$Time = $ctime;
}
}
示例12: initialize_page
function initialize_page()
{
$image_id = requestIdParam();
$image = Images::FindById($image_id);
$post_action = isset($_POST['submit']) ? $_POST['submit'] : "";
if ($post_action == "Save Image" || $post_action == "Save and Return to List") {
$success = '';
if (isset($_POST['delete'])) {
$image->delete(true);
setFlash("<h3>Image deleted</h3>");
redirect("/admin/list_images");
} else {
$old_name = $image->name;
$image->title = cleanupSpecialChars($_POST['title']);
$image->description = cleanupSpecialChars($_POST['description']);
if (ALLOW_SHORT_PAGE_NAMES) {
$image->name = $_POST['name'] == "" ? slug($_POST['title']) : slug($_POST['name']);
} else {
$image->name = slug($_POST['title']);
}
//$image->save();
$updateQuery = "UPDATE images SET title='{$image->title}', name='{$image->name}', description='{$image->description}' WHERE id='{$image->id}';";
if (mysql_Query($updateQuery, MyActiveRecord::Connection())) {
if ($old_name != $image->name) {
Pages::UpdateImageReferences($old_name, $image->name);
}
$success .= "Image changes saved / ";
} else {
die($updateQuery);
setFlash("<h3>FAILURE – Please notify HCd of this error: " . mysql_error() . "</h3>");
}
// Replace an existing image with a new one
if (is_uploaded_file($_FILES["new_image"]["tmp_name"])) {
$mimeType = $_FILES["new_image"]["type"];
$filetype = getFileExtension($_FILES["new_image"]["name"]);
//list($width) = getimagesize($_FILES["new_image"]["tmp_name"]);
$max_width = 0;
$max_height = 0;
if (defined("MAX_IMAGE_WIDTH")) {
$max_width = MAX_IMAGE_WIDTH;
}
if (defined("MAX_IMAGE_HEIGHT")) {
$max_height = MAX_IMAGE_HEIGHT;
}
resizeToMultipleMaxDimensions($_FILES["new_image"]["tmp_name"], $max_width, $max_height, $filetype);
// Open the uploaded file
$file = fopen($_FILES["new_image"]["tmp_name"], "r");
// Read in the uploaded file
$fileContents = fread($file, filesize($_FILES["new_image"]["tmp_name"]));
// Escape special characters in the file
$fileContents = AddSlashes($fileContents);
$updateQuery2 = "UPDATE images SET original='{$fileContents}', mime_type='{$mimeType}' WHERE id='{$image->id}';";
if (mysql_Query($updateQuery2, MyActiveRecord::Connection())) {
$success .= "Image replaced / ";
} else {
setFlash("FAILURE – Please notify HCd of this error: " . mysql_error() . "</h3>");
//die( $updateQuery2 );
}
}
}
if ($post_action == "Save and Return to List") {
redirect("/admin/list_images");
}
setFlash("<h3>" . substr($success, 0, -3) . "</h3>");
}
}
示例13: mysql_query
// tb_access ��Ҩ��繵��ҧẺ�ͺ���
$query3 = "SELECT * FROM tb_assess WHERE row_id = '$sRowid' and year = '$nPrefix' ";
$result3 = mysql_query($query3) or die( mysql_error($Conn) );
$nrow3 = mysql_num_rows($result3);
print "<font face='THSarabunPSK'><a href='menulst.php' ><B>������<BR>���������ѡ�������� 3</B></a></font>";
print "<BR>*********";
print "</body>";
if( $sIdname == $sPword ){
echo "<script>alert('����! ���ʼ�ҹ�ͧ��ҹ�ѧ���������¹�ŧ ��س�����¹���ʼ�ҹ�����������¹�������ͤ�����ʹ��¢ͧ��ҹ') </script>";
}
/*echo "<script>alert('�ٹ�����������зӡ�û�Ѻ��ا�ҹ�����Ť��������� �դ������繻Դ����ԡ������ 00.30 - 02.00 �ջѭ�ҡ����ҹ�Դ������� 6206') </script>"; */
// include("connect.inc");
$sql = "Select left(prefix,2) From runno where title = 'HN' ";
list($title_hn) = Mysql_fetch_row(Mysql_Query($sql));
$year_now = substr(date("Y")+543,2);
if($title_hn != $year_now){
$sql1= "Update runno set prefix = '56-', runno = 0 where title = 'HN' limit 1;";
$result1 = mysql_Query($sql1);
$sql2 = "Update runno set prefix = '56/', runno = 0 where title = 'AN' limit 1;";
$result2 = mysql_Query($sql2);
$sql3 = "Update runno set prefix = '56/', runno = 0 where title = 'nid_c' limit 1;";
$result3 = mysql_Query($sql3);
}
include("unconnect.inc");
?>
示例14: mysql_Query
//get paytax/fee
$gettax = mysql_Query("select * from tempassess a where a.owner_id='{$owner_id}' and a.business_id='{$business_id}'");
$dfv = 0;
while ($gett = mysql_fetch_assoc($gettax)) {
//while ($dfv < $v) {
$dfv++;
//display
$f++;
$disp = mysql_Query("select sum(amount) from ebpls_payment_details a, rpt_temp_abs b where a.owner_id='{$owner_id}' and a.business_id='{$business_id}' and a.tfoid='{$tfoid[$f]}' and a.tfoid = b.tfoid and or_no = '{$gp['payment_code']}' order by or_no asc");
//echo "select * from ebpls_payment_details a where a.owner_id='$owner_id' and a.business_id='$business_id' and a.tfoid='$tfoid[$f]' <br>";
//$disp = mysql_Query("select * from tempassess a where a.owner_id='$owner_id' and a.business_id='$business_id' and a.natureid='$gp[bus_code]' and a.tfoid='$tfoid[$f]'");
$cntm = mysql_num_rows($disp);
if ($tfoid[$f] != '') {
if ($cntm == 0 and $sassess == 1) {
//reg fee
$disp = mysql_Query("select sum(amount) from ebpls_payment_details a, rpt_temp_abs b where a.owner_id='{$owner_id}' and a.business_id='{$business_id}' and a.tfoid='{$tfoid[$f]}' and a.tfoid = b.tfoid and or_no = '{$gp['payment_code']}' order by or_no asc");
//$disp = mysql_Query("select * from tempassessz a where a.owner_id='$owner_id' and a.business_id='$business_id' and a.tfoid='$tfoid[$f]'");
}
$dis = mysql_fetch_row($disp);
$pdf->Cell(30, 5, number_format($dis[0], 2), 1, 0, 'R');
//tax/fee name
$newv[$f] = $newv[$f] + $dis[0];
}
}
$pdf->SetX($RX);
$pdf->Cell(40, 5, $gp[payment_code], 0, 0, 'C');
$pdf->Cell(10, 5, '', 0, 1, 'C');
}
}
$pdf->SetX(5);
$pdf->Cell(50, 5, '', 1, 0, 'C');
示例15: mysql_fetch_array
$obj3 = mysql_fetch_array(mysql_query("SELECT count(*) FROM inv WHERE owner='" . $login . "' AND object_id=" . $have_qwest["item3"] . " and object_type='wood'"));
if ($obj3[0] < $have_qwest["col3"]) {
$msg .= "Не хватает: " . $item3["name"] . " - " . (int) ($have_qwest["col3"] - $obj3[0]) . " штук...<br>";
} else {
$all_have[] = $have_qwest["item3"];
}
}
if ($all_count == count($all_have)) {
mysql_query("UPDATE users SET naqrada=naqrada+" . $have_qwest["add_naqrada"] . " WHERE login='{$login}'");
mysql_query("UPDATE qwest SET status=1 WHERE id=" . $have_qwest["id"]);
mysql_Query("DELETE FROM inv WHERE owner='" . $login . "' AND object_id=" . $have_qwest["item1"] . " and object_type='wood'");
if ($have_qwest["item2"]) {
mysql_Query("DELETE FROM inv WHERE owner='" . $login . "' AND object_id=" . $have_qwest["item2"] . " and object_type='wood'");
}
if ($have_qwest["item3"]) {
mysql_Query("DELETE FROM inv WHERE owner='" . $login . "' AND object_id=" . $have_qwest["item3"] . " and object_type='wood'");
}
$msg = "Поздравляю вы выполнили <b>Квест</b>, в честь этого вы получили бонус <b>" . $have_qwest["add_naqrada"] . " Ед. награды</b>.";
}
}
}
##==============================================================================
?>
<h3>Задания[Этаж 2]</h3>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="100%"><font color="#ff0000"><?php
echo $msg;
?>
</font></td>
<td nowrap>