当前位置: 首页>>代码示例>>PHP>>正文


PHP mysqlresult函数代码示例

本文整理汇总了PHP中mysqlresult函数的典型用法代码示例。如果您正苦于以下问题:PHP mysqlresult函数的具体用法?PHP mysqlresult怎么用?PHP mysqlresult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mysqlresult函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMailMessage

/**
* function to get the status of the invite sent to the user
* @param: $contact
*/
function getMailMessage($name) {
	$query=0;
	$query=mysqlquery("select * from vl_emails_outgoing where lower(name)='".strtolower($name)."'");
	if(mysqlnumrows($query)) {
		return mysqlresult($query,0,'description');
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:11,代码来源:functions.mailmessages.php

示例2: getUserInfoByID

/**
* function to get a user's details from their id
* @param: $id
* @param: $info - must correspond to the database field
*/
function getUserInfoByID($id,$info) {
	$query=0;
	$query=mysqlquery("select $info from vl_users where id='$id'");
	if(mysqlnumrows($query)) {
		return mysqlresult($query,0,$info);
	}
}
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:12,代码来源:functions.user.php

示例3: before_print

function before_print()
{
    global $book_id, $user_id, $print_text, $alt_text;
    if (!isset($_GET['page'])) {
        return;
    }
    if ($_GET['page'] == 16) {
        $sel = myquery("SELECT * FROM bookgame_users_flags WHERE bookgame={$book_id} AND user_id={$user_id} AND flag=2");
        if (!mysql_num_rows($sel)) {
            $print_text = 1;
            $alt_text = "Неимоверной силой воли ты отправляешь Пожирателей Душ туда, откуда они были призваны. Аргалакс в бешенстве и кричит:\n\t\t\t«Теперь я вызышаю Костяного Занбара и Балтуса Страшного!!!»\n\t\t\tОни материализуются и ты смог бы противиться их заклинаниям, только если бы у тебя есть были Щит Древней Тьмы и Щит Огня. Но их у тебя не оказалось, и ты бесславно погиб на поле боя!";
        }
    }
    if ($_GET['page'] == 17) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=2");
    }
    if ($_GET['page'] == 20) {
        myquery("INSERT INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=3,value=0 ON DUPLICATE KEY UPDATE value=LEAST(4,value*2)");
        myquery("UPDATE bookgame_users SET dex=dex+LEAST(4,dex*2) WHERE bookgame={$book_id} AND user_id={$user_id}");
    }
    if ($_GET['page'] == 21) {
        $check = mysqlresult(myquery("SELECT COUNT(*) FROM bookgame_users_flags WHERE bookgame={$book_id} AND user_id={$user_id} AND (flag=4 OR flag=7)"), 0, 0);
        if ($check != 2) {
            $print_text = 1;
            $alt_text = "«НЕЕЕЕТ!!!» - Аргалакс корчится в конвульсиях и его энергия выходит наружу. Вы впитываете её часть и восстанавливаете 3 выносливости.На этом твое приключение заканчивается";
        }
    }
    if ($_GET['page'] == 22) {
        myquery("INSERT INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=5,value=1 ON DUPLICATE KEY UPDATE value=value+1");
        myquery("UPDATE bookgame_users SET dex=dex+1 WHERE bookgame={$book_id} AND user_id={$user_id}");
    }
    if ($_GET['page'] == 41) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=4");
    }
    if ($_GET['page'] == 8) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=4");
    }
    if ($_GET['page'] == 19) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=6");
    }
    if ($_GET['page'] == 10) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=8");
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=9");
    }
    if ($_GET['page'] == 44) {
        list($gp) = mysqlresult(myquery("SELECT gp FROM bookgame_users WHERE bookgame={$book_id} AND user_id={$user_id}"), 0, 0);
        if ($gp >= 21) {
            myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=7");
            myquery("UPDATE bookgame_users SET gp=gp-21 WHERE user_id={$user_id} AND bookgame={$book_id}");
        }
    }
    if ($_GET['page'] == 45) {
        $check = mysqlresult(myquery("SELECT COUNT(*) FROM bookgame_users_flags WHERE bookgame={$book_id} AND user_id={$user_id} AND (flag=8 OR flag=9)"), 0, 0);
        if ($check != 2) {
            $print_text = 1;
            $alt_text = "«ААА!!!,- крик Аргалакса звенит под потолком.- Я вызываю Жаррадана Мара и Шарелу, Ведьму Снега!!» Ты можешь противиться заклинаниям двух колдунов, только если есть Щит Времени и Лёд. Но их у тебя не оказалось, и ты бесславно погиб на поле боя!";
        }
    }
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:59,代码来源:quest_demon.php

示例4: myquery

             $page = $allpage;
         }
         if ($page < 1) {
             $page = 1;
         }
         $result = myquery($sql);
         if ($result != false and mysql_num_rows($result) > 0) {
             while ($row = mysql_fetch_array($result)) {
                 $type = $row['type'];
                 echo '<form method="POST" action="shop.php?type=' . $type . '&buy=' . $row["id"] . '">';
                 $Item = new Item();
                 echo '<tr><td align="center">';
                 $Item->hint($row['id'], 0, '<a href="http://' . domain_name . '/info/?item=' . $row['id'] . '" target="_blank" ', 1);
                 echo '<img src="http://' . img_domain . '/item/' . $row["img"] . '.gif" border="0" alt="Посмотреть характеристики"></a></td><td>' . $row["name"] . '';
                 if ($row["race"] != 0) {
                     echo ' (Только для расы: <font color=ff0000><b>' . mysqlresult(myquery("SELECT name FROM game_har WHERE id=" . $row['race'] . ""), 0, 0) . '</b></font>)';
                 }
                 echo '</td><td align="center">' . round($row["item_cost"] / 100 * $shop["cena_prod"], 2) . '</td>';
                 echo '<td align="center"><input type="text" value="1" size="1" maxlength="3" name="kol"> <input type="submit" value="Купить" name="buy"></td></tr>';
                 echo '</form>';
             }
         }
         echo '<tr align=center><td colspan=4>';
         $href = '?type=' . $type . '&';
         echo '<center>Страница: ';
         show_page($page, $allpage, $href);
         $all = $pg;
         echo '<br>(Всего предметов: ' . $all . ')</td></tr></table>';
     }
 }
 if (!isset($_GET['type']) and !isset($_GET['buy']) and !isset($_GET['sell']) and !isset($_GET['ident']) and !isset($_GET['kleymo']) and !isset($_GET['remont'])) {
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:shop.php

示例5: myquery

            }
            if (!isset($_POST['retreat'])) {
                $_POST['retreat'] = 0;
            } else {
                $_POST['retreat'] = 1;
            }
            $up = myquery("update bookgame_step set text='" . $_POST['elm1'] . "',step='" . $_POST['page'] . "',flag='" . $_POST['flag'] . "',add_dex='" . $_POST['add_dex'] . "',add_master='" . $_POST['add_master'] . "',add_lucky='" . $_POST['add_lucky'] . "',add_gp='" . $_POST['add_gp'] . "',check_lucky='" . $_POST['check_lucky'] . "',retreat='" . $_POST['retreat'] . "' where step='{$edit}' AND bookgame=" . $_GET['book'] . "");
            $da = getdate();
            $log = myquery("INSERT INTO game_log_adm (adm,dei,cur_time,day,month,year)\n\t\t\t VALUES (\n\t\t\t '" . $char['name'] . "',\n\t\t\t 'Изменил страницу {$edit} книги-игры " . $_GET['book'] . "</b>',\n\t\t\t '" . time() . "',\n\t\t\t '" . $da['mday'] . "',\n\t\t\t '" . $da['mon'] . "',\n\t\t\t '" . $da['year'] . "')") or die(mysql_error());
            echo '<meta http-equiv="refresh" content="1;url=?opt=main&option=bookgamepage&book=' . $_GET['book'] . '">';
        }
    }
    if (isset($new)) {
        if (!isset($save)) {
            include_once 'style/tinyMCE/tinyMCE_header.php';
            $maxpage = mysqlresult(myquery("SELECT step FROM bookgame_step WHERE bookgame=" . $_GET['book'] . " ORDER BY step DESC LIMIT 1"), 0, 0);
            echo '<form action="" method="post">
			Номер страницы: <input type="text" size="5" name="page" value="' . ($maxpage + 1) . '"><br />
			На странице прибавить: <input type="text" size="5" name="add_dex" value="0"> выносливости, <input type="text" size="5" name="add_master" value="0"> мастерства, <input type="text" size="5" name="add_lucky" value="0"> удачи, <input type="text" size="5" name="add_gp" value="0"> монет<br /> 
			Для страницы боя: <input type="checkbox" name="lucky" value="0"> есть проверка удачи, <input type="checkbox" name="retreat" value="0"> есть побег из боя<br />
			Тип страницы: <select name="flag">
			<option value="0" selected>Обычная</option>
			<option value="1">Провал</option>
			<option value="2">Финиш</option>
			<option value="3">Старт</option>
			<option value="4">Бой</option>
			<option value="5">Проверка удачи</option>
			</select><br /><br />
			Текст:';
            ?>
			<textarea id="elm1" name="elm1" rows="25" cols="80" style="width: 100%">
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:bookgamepage.inc.php

示例6: mysqlresult

}
if (isset($_GET['save'])) {
    $item_id = (int) $_GET['save'];
    $complect_id = (int) $_GET['read'];
    $item_name = mysqlresult(myquery("SELECT name FROM game_items_factsheet WHERE id=" . $item_id . ""), 0, 0);
    $complect_name = mysqlresult(myquery("SELECT name FROM game_items_factsheet WHERE id=" . $complect_id . ""), 0, 0);
    myquery("INSERT INTO game_items_complect (item_id,complect_id) VALUES ({$item_id},{$complect_id}) ON DUPLICATE KEY UPDATE item_id={$item_id}");
    $da = getdate();
    $log = myquery("INSERT INTO game_log_adm (adm,dei,cur_time,day,month,year) \n\t VALUES (\n\t '" . $char['name'] . "',\n\t 'Для предмета: <b>" . $item_name . "</b> добавил(изменил) состав комплекта " . $complect_name . ": предмет <b>" . $item_name . "</b>',\n\t '" . time() . "',\n\t '" . $da['mday'] . "',\n\t '" . $da['mon'] . "',\n\t '" . $da['year'] . "')") or die(mysql_error());
    $response = 'ok';
}
if (isset($_GET['delete'])) {
    $id = (int) $_GET['delete'];
    list($complect_id, $item_id) = mysql_fetch_array(myquery("SELECT complect_id,item_id FROM game_items_complect WHERE id={$id}"));
    $item_name = mysqlresult(myquery("SELECT name FROM game_items_factsheet WHERE id=" . $item_id . ""), 0, 0);
    $complect_name = mysqlresult(myquery("SELECT name FROM game_items_factsheet WHERE id=" . $complect_id . ""), 0, 0);
    myquery("DELETE FROM game_items_complect WHERE id={$id}");
    $da = getdate();
    $log = myquery("INSERT INTO game_log_adm (adm,dei,cur_time,day,month,year) \n\t VALUES (\n\t '" . $char['name'] . "',\n\t 'Для предмета: <b>" . $item_name . "</b> удалил из комплекта " . $complect_name . ": предмет <b>" . $item_name . "</b>',\n\t '" . time() . "',\n\t '" . $da['mday'] . "',\n\t '" . $da['mon'] . "',\n\t '" . $da['year'] . "')") or die(mysql_error());
    $response = 'ok';
}
// При изменении состава комплекта пересчитать всех игроков.
if (isset($_GET['save']) or isset($_GET['delete'])) {
    $complect_id = (int) $_GET['read'];
    // Снимаем комплект со всех, у кого он был одет.
    $res = myquery("SELECT `id`,`user_id` FROM `game_items` WHERE `priznak`=0 AND `used`=22 AND `item_id` = {$complect_id}");
    while ($list = mysql_fetch_array($res)) {
        $item = new Item($list['id']);
        $item->setChar($list['user_id']);
        $item->down();
    }
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:item_complect.php

示例7: setLocation

}
$CC_overload = $char['CW'];
if ($CC_overload < 0) {
    $CC_overload = 0;
}
if ($char['PR'] <= 0) {
    setLocation("act.php?func=main&reason=prana");
    if (function_exists("save_debug")) {
        save_debug();
    }
    exit;
}
$da = getdate();
//Установим задержку
if ($user_time < $char['delay']) {
    $zelye_bodrosti = mysqlresult(myquery("SELECT COUNT(*) FROM game_obelisk_users WHERE user_id=" . $user_id . " AND type=3 AND time_end>UNIX_TIMESTAMP()"), 0, 0);
    //Персонаж стопнут
    if (isset($char['block']) and $char['block'] == 1) {
        setLocation("act.php?func=main&reason=block");
        if (function_exists("save_debug")) {
            save_debug();
        }
        exit;
    } elseif ($dolina == 0 and $zelye_bodrosti == 0) {
        //Задержка, вызванная наличием слабого коня
        // if ( ($char['vsadnik']<63 AND $char['reinc']<>0) )
        // {
        // setLocation("act.php?func=main&reason=koni");
        // {if (function_exists("save_debug")) save_debug(); exit;}
        // }
        //Перевес
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:move.php

示例8: break_axe

}
function break_axe(&$action1)
{
    global $user_id;
    myquery("UPDATE game_items SET item_uselife=item_uselife-2 WHERE priznak=0 AND user_id={$user_id} AND used=21");
    list($id_item, $cur_uselife) = mysql_fetch_array(myquery("SELECT id,item_uselife FROM game_items WHERE priznak=0 AND user_id={$user_id} AND used=21"));
    if ($cur_uselife <= 0) {
        $Item = new Item($id_item);
        $Item->down();
        craft_DelFunc($user_id);
        $action1 = 'У тебя сломано кайло!';
    }
}
if ($local_func_id == 5) {
    $sel = myquery("SELECT * FROM craft_build_rab WHERE user_id={$user_id}");
    $est_items = mysqlresult(myquery("SELECT COUNT(*) FROM game_items WHERE item_id=" . $id_item_kaylo . " AND user_id={$user_id} AND used=21 AND priznak=0"), 0, 0);
    //Установим время работы
    $char_lumberjack = getCraftLevel($user_id, 5);
    if (domain_name == 'testing.rpg.su' or domain_name == 'localhost') {
        $end_time = time() + 5;
    } else {
        $end_time = time() + max(120, 5 * 60 - $char_lumberjack * 10);
    }
    if ($sel != false and mysql_num_rows($sel) > 0 and $broken_instrument != 1 and $est_items == 1) {
        $sel_lumber = myquery("SELECT * FROM craft_build_stonemason WHERE user_id={$user_id} AND build_id={$build_id} LIMIT 1");
        if ($sel_lumber == false or mysql_num_rows($sel_lumber) == 0) {
            //игрок еще не начал рубку
            echo '<span style="font-weight:900;font-size:13px;font-family:Arial;color:#FFFF00">Каменоломня</span><br />';
            $ustroil = 0;
            if (isset($_GET['id']) and $broken_instrument == 0) {
                $id = (int) $_GET['id'];
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:stonemason.inc.php

示例9: get_new_card

function get_new_card($charboy, $hod)
{
    unset($cards1);
    unset($cards2);
    unset($cards3);
    $kol1 = 0;
    $kol2 = 0;
    $kol3 = 0;
    $arcomage_win = mysqlresult(myquery("SELECT arcomage_win FROM game_users WHERE user_id='" . $charboy['user_id'] . "'"), 0, 0);
    /*
    	if ($arcomage_win<15) $end = 15;
    	elseif ($arcomage_win<35) $end = 18;
    	elseif ($arcomage_win<75) $end = 21;
    	elseif ($arcomage_win<145) $end = 24;
    	elseif ($arcomage_win<265) $end = 27;
    	else */
    $end = 35;
    for ($i = 1; $i <= $end; $i++) {
        $check = mysql_result(myquery("SELECT COUNT(*) FROM arcomage_users_cards WHERE card_id='{$i}' AND arcomage_id='" . $charboy['arcomage_id'] . "'"), 0, 0) or mysql_result(myquery("SELECT COUNT(*) FROM arcomage_history WHERE card_id='{$i}' AND arcomage_id='" . $charboy['arcomage_id'] . "' AND hod='{$hod}'"), 0, 0);
        if ($check == 0) {
            $cards1[] = $i;
            $kol1++;
        }
    }
    /*
    	if ($arcomage_win<15) $end = 64;
    	elseif ($arcomage_win<35) $end = 67;
    	elseif ($arcomage_win<75) $end = 70;
    	elseif ($arcomage_win<145) $end = 73;
    	elseif ($arcomage_win<265) $end = 76;
    	else */
    $end = 83;
    for ($i = 50; $i <= $end; $i++) {
        $check = mysql_result(myquery("SELECT COUNT(*) FROM arcomage_users_cards WHERE card_id='{$i}' AND arcomage_id='" . $charboy['arcomage_id'] . "'"), 0, 0) or mysql_result(myquery("SELECT COUNT(*) FROM arcomage_history WHERE card_id='{$i}' AND arcomage_id='" . $charboy['arcomage_id'] . "' AND hod='{$hod}'"), 0, 0);
        if ($check == 0 and $i != 54) {
            $cards2[] = $i;
            $kol2++;
        }
    }
    /*
    	if ($arcomage_win<15) $end = 114;
    	elseif ($arcomage_win<35) $end = 117;
    	elseif ($arcomage_win<75) $end = 120;
    	elseif ($arcomage_win<145) $end = 123;
    	elseif ($arcomage_win<265) $end = 126;
    	else */
    $end = 134;
    for ($i = 100; $i <= $end; $i++) {
        $check = mysql_result(myquery("SELECT COUNT(*) FROM arcomage_users_cards WHERE card_id='{$i}' AND arcomage_id='" . $charboy['arcomage_id'] . "'"), 0, 0) or mysql_result(myquery("SELECT COUNT(*) FROM arcomage_history WHERE card_id='{$i}' AND arcomage_id='" . $charboy['arcomage_id'] . "' AND hod='{$hod}'"), 0, 0);
        if ($check == 0 and $i != 104) {
            $cards3[] = $i;
            $kol3++;
        }
    }
    $r = mt_rand(1, 3);
    if ($r == 1) {
        $t = mt_rand(0, $kol1 - 1);
        $new_card = $cards1[$t];
    } elseif ($r == 2) {
        $t = mt_rand(0, $kol2 - 1);
        $new_card = $cards2[$t];
    } elseif ($r == 3) {
        $t = mt_rand(0, $kol3 - 1);
        $new_card = $cards3[$t];
    }
    return $new_card;
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:67,代码来源:lib_arcomage.inc.php

示例10: mysqlresult

                     }
                     $kol_all = mysqlresult(myquery("SELECT COUNT(*) FROM game_turnir_users WHERE turnir_id=" . $tur['id'] . ""), 0, 0);
                     if ($kol_all == 2 * $tur['kol']) {
                         start_group($tur);
                     }
                 }
             }
         }
     } elseif ($tur['type'] == 4 or $tur['type'] == 5) {
         if ($char['clevel'] >= $tur['level_min'] and $char['clevel'] <= $tur['level_max']) {
             if ($tur['timestamp'] + 60 * $tur['timeout'] >= time()) {
                 $kol_on_side = mysqlresult(myquery("SELECT COUNT(*) FROM game_turnir_users WHERE turnir_id=" . $tur['id'] . ""), 0, 0);
                 if ($kol_on_side < $tur['kol']) {
                     myquery("INSERT IGNORE INTO game_turnir_users (turnir_id,side,user_id,from_boy) VALUES (" . $tur['id'] . ",1,{$user_id},'{$from_boy}')");
                 }
                 $kol_all = mysqlresult(myquery("SELECT COUNT(*) FROM game_turnir_users WHERE turnir_id=" . $tur['id'] . ""), 0, 0);
                 if ($kol_all == $tur['kol']) {
                     start_chaos($tur);
                 }
             }
         }
     }
 }
 if (isset($_POST['submit_zayavka'])) {
     //подаем заявку
     if (isset($_POST['sel_type']) and $_POST['sel_type'] >= 1 and $_POST['sel_type'] <= 99) {
         if ($_POST['sel_type'] == 1) {
             if (isset($_POST['duel_level']) and $_POST['duel_level'] >= 0 and $_POST['duel_level'] <= 2) {
                 if (isset($_POST['duel_time']) and ($_POST['duel_time'] == 1 or $_POST['duel_time'] == 3 or $_POST['duel_time'] == 5 or $_POST['duel_time'] == 10 or $_POST['duel_time'] == 15 or $_POST['duel_time'] == 20)) {
                     if (isset($_POST['duel_format']) and ($_POST['duel_format'] == 1 or $_POST['duel_format'] == 2 or $_POST['duel_format'] == 3 or $_POST['duel_format'] == 4)) {
                         myquery("INSERT INTO game_turnir (type,level_min,level_max,kol,timeout,timestamp,format,map) VALUES (1," . ($char['clevel'] - $_POST['duel_level']) . "," . ($char['clevel'] + $_POST['duel_level']) . ",1," . $_POST['duel_time'] . "," . time() . "," . $_POST['duel_format'] . "," . $char['map_name'] . ")");
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:turnir.inc.php

示例11: add_user

 public function add_user($id = 0, $user_id, $kol = 1, $dead_time = 0, $archive_users = 0, $gp = 0, $gp_reason = 0)
 {
     $check = 0;
     if ($gp >= 0 or $this->char['GP'] > -$gp) {
         if ($id > 0) {
             $this->init_res(0, $id);
         }
         $weight = $kol * $this->res['weight'];
         if ($dead_time == 0 and $this->res['life_time'] > 0) {
             $dead_time = $this->res['life_time'] + time();
         }
         //Добавляем ресурс игроку
         if ($kol > 0) {
             $prov = mysqlresult(myquery("SELECT count(*) FROM game_wm WHERE user_id='" . $user_id . "' AND type=1"), 0, 0);
             if ($this->char['CW'] + $weight <= $this->char['CC'] or $prov > 2) {
                 myquery("INSERT INTO craft_resource_user (user_id,res_id,col,dead_time) VALUES ('" . $user_id . "','" . $this->res['id'] . "','" . $kol . "','" . $dead_time . "') \n\t\t\t\t\t\t\t ON DUPLICATE KEY UPDATE col=col+'" . $kol . "', dead_time=GREATEST('" . $dead_time . "', dead_time)");
                 $check = 1;
             } else {
                 $check = 0;
                 $this->message = '<b><font color=#FF0000 size=3>У Вас недостаточно места в инвентаре!</font></b>';
                 $this->message_type = 1;
             }
         } elseif ($kol < 0) {
             if (!isset($this->res_user['col'])) {
                 $this->init_res_user(0, $user_id);
             }
             if (!isset($this->res_user['col']) or -$kol > $this->res_user['col']) {
                 $check = 0;
                 $this->message = '<br><b><font color=#FF0000 size=3>У Вас нет ресурса <b>"' . $this->res['name'] . '"</b> в нужном количестве!</font></b>';
             } else {
                 if (-$kol == $this->res_user['col']) {
                     myquery("DELETE FROM craft_resource_user WHERE user_id='" . $user_id . "' AND res_id='" . $this->res['id'] . "'");
                     $check = 1;
                 } else {
                     myquery("UPDATE craft_resource_user SET col=col+" . $kol . " WHERE user_id='" . $user_id . "' AND res_id='" . $this->res['id'] . "' ");
                     $check = 1;
                 }
             }
         }
     } else {
         $this->message = '<b><font color=#FF0000 size=3>У Вас недостаточно денег для свершения операции!</font></b>';
         $this->message_type = 2;
         $check = 0;
     }
     if ($check == 1) {
         myquery("UPDATE game_users SET CW=CW +'" . $weight . "', GP=GP+'" . $gp . "' WHERE user_id='" . $user_id . "' LIMIT 1");
         $this->char['CW'] = $this->char['CW'] + $weight;
         if ($gp_reason > 0) {
             $this->char['GP'] = $this->char['GP'] + $gp;
             setGP($user_id, $gp, $gp_reason);
         }
         if ($archive_users == 1) {
             myquery("UPDATE game_users_archive SET CW=CW +'" . $weight . "' WHERE user_id='" . $user_id . "' LIMIT 1");
         }
     }
     return $check;
 }
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:57,代码来源:class_resource.php

示例12: list

     list($medal_id, $medal_name) = mysql_fetch_array(myquery("SELECT game_medal.id, game_medal.nazv From game_lr_services Join game_medal On game_lr_services.name=game_medal.nazv Where game_lr_services.serv_id={$id}"));
     if ($cost == -1) {
         echo '<center><font face=verdana color=ff0000 size=2>У вас нет Личного Рейтинга на покупку данной услуги!</font><meta http-equiv="refresh" content="4;url=town.php?option=' . $option . '"><br />';
     } elseif (mysql_num_rows(myquery("Select * From game_medal_users Where medal_id={$medal_id}")) > 0) {
         echo '<center><font face=verdana color=ff0000 size=2>У Вас уже есть ' . $medal_name . '!</font><meta http-equiv="refresh" content="4;url=town.php?option=' . $option . '"><br />';
     } else {
         $date = date("d.m.Y");
         myquery("Insert into game_medal_users (user_id, medal_id, zachto) Values ({$user_id}, {$medal_id}, '{$date}')");
         myquery("Insert into game_lr_services_hist (user_id, serv_id, lr, value) Values ({$user_id}, {$id}, {$cost}, {$medal_id})");
         echo '<center><font face=verdana color=white size=2><b>Вам выдана ' . $medal_name . '!</b></font><meta http-equiv="refresh" content="4;url=town.php?option=' . $option . '">';
     }
 } elseif (isset($_GET['action']) and $_GET['action'] == 'new_town') {
     $id = 3;
     $cost = check_lr($user_id, $id);
     $attr = $_GET['attr'];
     $free_square = 100 - (int) mysqlresult(myquery("SELECT SUM(square) FROM houses_users WHERE town_id={$attr}"), 0, 0);
     //количество свободных соток земли в желаемом городе
     list($town_id) = mysql_fetch_array(myquery("Select town_id FROM houses_users WHERE user_id={$user_id}"));
     list($town_name) = mysql_fetch_array(myquery("Select rustown From game_gorod Where game_gorod.town={$attr}"));
     if ($cost == -1) {
         echo '<center><font face=verdana color=ff0000 size=2>У вас нет Личного Рейтинга на покупку данной услуги!</font><meta http-equiv="refresh" content="4;url=town.php?option=' . $option . '"><br />';
     } elseif (mysql_num_rows(myquery("Select * FROM houses_users WHERE user_id={$user_id}")) == 0) {
         echo '<center><font face=verdana color=ff0000 size=2>У Вас нет дома!</font><meta http-equiv="refresh" content="4;url=town.php?option=' . $option . '"><br />';
     } elseif ($town_id == $attr) {
         echo '<center><font face=verdana color=ff0000 size=2>Вы живёте в выбранном городе!</font><meta http-equiv="refresh" content="4;url=town.php?option=' . $option . '"><br />';
     } elseif (mysql_num_rows(myquery("Select * FROM houses_users WHERE user_id={$user_id} and square<={$free_square} and square<>0")) == 0) {
         echo '<center><font face=verdana color=ff0000 size=2>К сожалению, в выбранном Вами городе нет необходимого числа свободных соток!</font><meta http-equiv="refresh" content="4;url=town.php?option=' . $option . '"><br />';
     } else {
         myquery("Update houses_users Set town_id={$attr} where user_id={$user_id}");
         myquery("Insert into game_lr_services_hist (user_id, serv_id, lr, value) Values ({$user_id}, {$id}, {$cost}, {$town_id})");
         echo '<center><font face=verdana color=white size=2><b>Ваш дом перемещён в ' . $town_name . '!</b></font><meta http-equiv="refresh" content="4;url=town.php?option=' . $option . '">';
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:glorystore.inc.php

示例13: while

			<td><a href="admin.php?opt=main&option=nakaz&napr=DESC&sort=date_zak">Длит.</a>        </td>
			<td><a href="admin.php?opt=main&option=nakaz&napr=ASC&sort=adm">Админ</a></td>
			<td><a href="admin.php?opt=main&option=nakaz&napr=ASC&sort=text">Описание бана</a></td>
			</td><td>Удал.</td>
	</tr>';
    $i = 0;
    while ($nakaz = mysql_fetch_array($result)) {
        $i++;
        $color = '#585858';
        if ($i % 2 == 0) {
            $color = '#2D2D2D';
        }
        $name = get_user('name', $nakaz['user_id']);
        echo '<tr>
					<td bgcolor=' . $color . '>' . $name . '</td>
					<td bgcolor=' . $color . '>' . mysqlresult(myquery("SELECT name FROM game_zakon WHERE id=" . $nakaz['id_zakon'] . ""), 0, 0) . '</td>
					<td bgcolor=' . $color . '>' . $nakaz['date_nak'] . '</td>
					<td bgcolor=' . $color . '>';
        if ($nakaz['nakaz'] == 'ban') {
            $bantime = '';
            if ($nakaz['date_zak'] / 360 < 1) {
                $bantime = '' . round($nakaz['date_zak'] / 60, 0) . ' мин.';
            } elseif ($nakaz['date_zak'] / 8640 < 1) {
                $hour = floor($nakaz['date_zak'] / 360);
                $minute = round(($nakaz['date_zak'] - $hour * 360) / 60, 0);
                $bantime = '' . $hour . ' час. ' . $minute . ' мин.';
            } else {
                $day = floor($nakaz['date_zak'] / 8640);
                $nakaz['date_zak'] = $nakaz['date_zak'] - $day * 8640;
                $hour = floor($nakaz['date_zak'] / 360);
                $minute = round(($nakaz['date_zak'] - $hour * 360) / 60, 0);
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:nakaz.inc.php

示例14: getCraftTimes

function getCraftTimes($user_id, $craft_index)
{
    $sel = myquery("SELECT times FROM game_users_crafts WHERE user_id={$user_id} AND craft_index={$craft_index}");
    if ($sel != false and mysql_num_rows($sel) > 0) {
        return mysqlresult($sel, 0, 0);
    } else {
        return 0;
    }
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:9,代码来源:lib_craft.inc.php

示例15: max

     }
     break;
     // Просмотр выбранного типа предметов на рынке
 // Просмотр выбранного типа предметов на рынке
 case 'viewtype':
     echo "В инвентаре свободно место для <b>" . max(0, $char['CC'] - $char['CW']) . "</b> кг.";
     $type = (int) $_GET['type'];
     if (!isset($_GET['page']) or $_GET['page'] < 1) {
         $page = 1;
     } else {
         $page = (int) $_GET['page'];
     }
     $line = 15;
     $player_kuzn = 0;
     if ($type != 13 && $type != 19 && $type != 20 && $type != 21 && $type != 22 && $type != 97) {
         $player_kuzn = mysqlresult(myquery("SELECT COUNT(*) FROM `game_users_crafts` WHERE  `user_id`=" . $char['user_id'] . " AND `craft_index`=12 AND `profile`=1;"), 0, 0);
         if ($player_kuzn) {
             $kuzn_border_by_level = 90 - 8 * getCraftLevel($char['user_id'], 12);
         }
     }
     if ($dostup_clan == 2) {
         $pg = myquery("SELECT COUNT(*) FROM game_items WHERE user_id='" . $user_id . "' and priznak=1 and town='" . $town . "' and sell_time>'" . $time_for_check . "' AND post_to=0 and item_id IN (select id from game_items_factsheet where type='" . $type . "' AND item_id NOT IN (" . $quest_item_ids . "));");
     } else {
         $pg = myquery("SELECT COUNT(*) FROM game_items WHERE priznak=1 and town='" . $town . "' and sell_time>'" . $time_for_check . "' AND post_to=0 and item_id IN (select id from game_items_factsheet where type='" . $type . "' AND item_id NOT IN (" . $quest_item_ids . "));");
     }
     $allpage = ceil(mysql_result($pg, 0, 0) / $line);
     if ($allpage == 0) {
         echo '<meta http-equiv="refresh" content="1;url=town.php?option=' . $option . '">';
     } else {
         if ($page > $allpage) {
             $page = $allpage;
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:old_items.inc.php


注:本文中的mysqlresult函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。