![]() |
Задавайте вопросы, мы ответим
Вы не зашли.
Здравствуйте.У меня есть проблема на уже работуещем сайте.
На одной из страниц выдает вот такую ошибку
SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '05, victories = victories + 1, effectiveness = 100 / all_games * vic' at line 4 at /www/vcontre/www/htdocs/classes/modules/clans/mapper/Clans.mapper.class.php line 682
Array ( => 1064 [message] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '05, victories = victories + 1, effectiveness = 100 / all_games * vic' at line 4 [query] => UPDATE prefix_clans SET all_games = all_games + 1, rating = rating + 0,05, victories = victories + 1, effectiveness = 100 / all_games * victories WHERE name_url = 'dlg_clan' [context] => /www/vcontre/www/htdocs/classes/modules/clans/mapper/Clans.mapper.class.php line 68
сам фаил Clans.mapper.class.php
<?php
/*---------------------------------------------------------------------------
* @Module Name: Clans
* @Description: ClanWars for LiveStreet
* @Version: 1.0
* @Author: trim06
* @LiveStreet Version: 0.3.1
* @File Name: Clans.mapper.class.php
* @License: GNU GPL v2, http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*----------------------------------------------------------------------------
*/
class Mapper_Clans extends Mapper {
public function GetClanUsers($clanId) {
$sql = "SELECT
u.*
FROM
".DB_TABLE_CLANS_USERS." as cf,
".DB_TABLE_USER." as u
WHERE
clan_id = ?d
AND
cf.user_id = u.user_id
AND
u.user_activate = 1
ORDER BY u.user_login;
";
$aUsers=array();
if ($aRows=$this->oDb->select($sql,$clanId)) {
foreach ($aRows as $aUser) {
$aUsers[]=new UserEntity_User($aUser);
}
}
return $aUsers;
}
public function AddClanUser($clanId,$userId) {
$sql = 'INSERT INTO '.DB_TABLE_CLANS_USERS.'
(clan_id,
user_id
)
VALUES(?d, ?d)';
if($this->oDb->query($sql,$clanId,$userId))
{
$sql = 'UPDATE '.DB_TABLE_CLANS.' SET people_count = people_count+1 WHERE id = ?d';
if ($this->oDb->query($sql, $clanId)){
return true;
}
return false;
}
return false;
}
public function RemoveClanUser($clanId,$userId) {
$sql = 'DELETE FROM '.DB_TABLE_CLANS_USERS.' WHERE clan_id=?d AND user_id=?d';
if($this->oDb->query($sql,$clanId,$userId))
{
$sql = 'UPDATE '.DB_TABLE_CLANS.' SET people_count = people_count-1 WHERE id = ?d';
if ($this->oDb->query($sql, $clanId)){
return true;
}
return true;
}
return false;
}
public function IsInClan($clanId,$userId) {
$sql = "SELECT clan_id FROM ".DB_TABLE_CLANS_USERS." WHERE clan_id=?d AND user_id=?d";
if ($aRows=$this->oDb->selectRow($sql, $clanId,$userId))
{
return true;
}
return false;
}
public function GetClansForUserId($userId){
$sql = "SELECT
cl.*
FROM
".DB_TABLE_CLANS." cl, ".DB_TABLE_CLANS_USERS. " clu WHERE clu.clan_id = cl.id AND clu.user_id = ?d";
$aReturn=array();
if ($aRows=$this->oDb->select($sql,$userId)) {
foreach ($aRows as $aRow) {
$aReturn[]=new ClansEntity_Clan($aRow);
}
}
return $aReturn;
}
public function GetClanByOwnerId2($owner_id) {
$sql = "SELECT * FROM ".DB_TABLE_CLANS." WHERE owner_id = ?d";
if ($aRow=$this->oDb->selectRow($sql,$owner_id)) {
return new ClansEntity_Clan($aRow);
}
return null;
}
public function AddClan($ownerId, $clanName, $nameUrl, $clanPeople, $clanDesc, $urlHomePage, $pathAvatar) {
$clanPeopleCount = count(explode(',', $clanPeople));
$sql = 'INSERT INTO '.DB_TABLE_CLANS.'
(owner_id,
name,
name_url,
people,
people_count,
description,
reg_date,
avator,
url_home_page
)
VALUES(?d, ?, ?, ?, ?d, ?, NOW(), ?, ?)
';
if($clanId = $this->oDb->query($sql, $ownerId, $clanName, $nameUrl, $clanPeople, $clanPeopleCount, $clanDesc, $pathAvatar, $urlHomePage))
{
$sql = 'INSERT INTO '.DB_TABLE_CLANS_USERS. '( clan_id, user_id) VALUES (?d, ?d)';
$this->oDb->query($sql,$clanId,$ownerId);
$this->DropInviteClanCreate($ownerId);
return true;
}
return false;
}
public function UpdateClan($clanId, $ownerId, $clanPeople, $clanName, $nameUrl, $clanDesc, $urlHomePage, $pathAvatar)
{
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
name = ?,
name_url = ?,
people = ?,
description = ?,'.
(($pathAvatar) ? "avator = '".$pathAvatar."'," : '').
'url_home_page = ?,
people_count = ?d
WHERE
owner_id = ?d AND id = ?d
';
$clanPeopleCount = count(explode(',', $clanPeople));
if ($this->oDb->query($sql, $clanName, $nameUrl, $clanPeople, $clanDesc, $urlHomePage, $clanPeopleCount, $ownerId, $clanId))
{
return true;
}
return false;
}
public function GetClans($status,&$iCount,$iCurrPage,$iPerPage)
{
$sql = 'SELECT * FROM '.DB_TABLE_CLANS.' WHERE status=?d
AND id NOT IN (SELECT clan_id
FROM '.DB_TABLE_CLANS_BANS.'
WHERE ban_active=1
GROUP BY clan_id)
ORDER BY rating DESC LIMIT ?d, ?d';
$status = ($status=='good') ? 0 : 1;
if($aRows=$this->oDb->selectPage($iCount, $sql, $status, ($iCurrPage-1)*$iPerPage, $iPerPage))
{
return $aRows;
}
return null;
}
public function GetBannedClans(&$iCount,$iCurrPage,$iPerPage)
{
$sql = 'SELECT c.*
FROM
(SELECT clan_id
FROM '.DB_TABLE_CLANS_BANS.'
WHERE ban_active=1
GROUP BY clan_id) as cb
JOIN '.DB_TABLE_CLANS.' as c ON c.id=cb.clan_id
ORDER BY rating
DESC LIMIT ?d, ?d';
if($aRows=$this->oDb->selectPage($iCount, $sql, ($iCurrPage-1)*$iPerPage, $iPerPage))
{
return $aRows;
}
return null;
}
public function GetClanById($id)
{
$sql = 'SELECT * FROM '.DB_TABLE_CLANS.' WHERE id = ?d';
if ($aRows=$this->oDb->selectRow($sql, $id))
{
return $aRows;
}
return null;
}
public function GetClanByName($name)
{
$sql = 'SELECT * FROM '.DB_TABLE_CLANS.' WHERE name = ?';
if ($aRows=$this->oDb->selectRow($sql, $name))
{
return $aRows;
}
return null;
}
public function GetClanByNameUrl($name)
{
$sql = 'SELECT * FROM '.DB_TABLE_CLANS.' WHERE name_url = ?';
if ($aRows=$this->oDb->selectRow($sql, $name))
{
return $aRows;
}
return null;
}
public function GetClanByOwnerId($ownerId)
{
$sql = 'SELECT * FROM '.DB_TABLE_CLANS.' WHERE owner_id = ?d';
if ($aRows=$this->oDb->selectRow($sql, $ownerId))
{
return $aRows;
}
return null;
}
public function isModeratorClans($id)
{
$sql = 'SELECT * FROM '.DB_TABLE_CLANS_MODERATORS.' WHERE moderator_id = ?d';
if ($aRows=$this->oDb->selectRow($sql, $id))
{
return $aRows['moderator_id'];
}
return null;
}
public function GetModeredCount($id) {
$sql = 'SELECT * FROM '.DB_TABLE_CLANS_MODERATORS.' WHERE moderator_id = ?d';
if ($aRows=$this->oDb->selectRow($sql, $id))
{
return $aRows['modered_count'];
}
return null;
}
public function ModeratorClansAdd($id, $moderator_name)
{
$sql = 'INSERT INTO '.DB_TABLE_CLANS_MODERATORS.'
(moderator_id,
moderator_name
)
VALUES(?d, ?)
';
if($this->oDb->query($sql, $id, $moderator_name)) {
return true;
}
return false;
}
public function ModeratorClansDel($id)
{
$sql = 'DELETE FROM '.DB_TABLE_CLANS_MODERATORS.' WHERE moderator_id = ?d';
if($this->oDb->query($sql, $id)) {
return true;
}
return false;
}
public function getClansModerators()
{
$sql = 'SELECT cm.moderator_id,
u.user_login,
u.user_profile_avatar,
u.user_profile_avatar_type
FROM '.DB_TABLE_CLANS_MODERATORS.' as cm
JOIN '.DB_TABLE_USER.' as u ON cm.moderator_id=u.user_id';
$aModers = array();
if($aRows = $this->oDb->select($sql))
{
foreach ($aRows as $aUser) {
$aModers[]=new ClansEntity_ClanModerators($aUser);
}
return $aModers;
}
return null;
}
public function BanClan(ClansEntity_ClanBan $oBan)
{
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
status = ?d,
bannedtime = ?
WHERE
id = ?d
';
if($this->oDb->query($sql,$oBan->isActive(), $oBan->getBanExpired(), $oBan->getClanId())) {
return true;
}
return false;
}
/* public function BanClan($clanId, $bantime)
{
if(preg_match('/(\d{2})\.(\d{2})\.(\d{4})/', $bantime, $time))
{
$bantime = mktime(0, 0, 0, $time[2], $time[1], $time[3]);
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
status = ?d,
bannedtime = ?
WHERE
id = ?d
';
if($this->oDb->query($sql,1, $bantime, $clanId)) {
return true;
}
}
return false;
}
*/
public function ClanBan(ClansEntity_ClanBan $oBan)
{
$sql = 'INSERT INTO '.DB_TABLE_CLANS_BANS.'
(clan_id,
ban_date,
ban_expired,
ban_comment,
moder_id,
ban_unlim,
ban_active
)
VALUES(?d, ?, ?, ?, ?d, ?d, ?d)
';
if($this->oDb->query($sql,$oBan->getClanId(),$oBan->getBanDate(),$oBan->getBanExpired(),$oBan->getBanComment(),$oBan->getModerId(),$oBan->isUnlimited(),$oBan->isActive())) {
return true;
}
return false;
}
public function ClanUnban($clanId)
{
$sql = 'UPDATE '.DB_TABLE_CLANS_BANS.'
SET
ban_active = ?d
WHERE
clan_id = ?d and ban_active=1
';
if($this->oDb->query($sql, 0, $clanId)) {
return true;
}
return false;
}
/*
*удалить
*/
public function unBanClan($clanId)
{
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
status = ?d
WHERE
id = ?d and status=1
';
if($this->oDb->query($sql, 0, $clanId)) {
return true;
}
return false;
}
public function unBanClans()
{
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
status = 0
WHERE
bannedtime <= ?
';
if($this->oDb->query($sql, time() )) {
return true;
}
return false;
}
public function ClansUnban()
{
$sql = 'UPDATE '.DB_TABLE_CLANS_BANS.'
SET
ban_active = 0
WHERE
ban_expired <= ?
AND
ban_active=1
AND
ban_unlim <> 1
';
if($this->oDb->query($sql, date("Y-m-d H:i:s"))) {
return true;
}
return false;
}
public function DeleteClan($id)
{
$sql = 'DELETE FROM '.DB_TABLE_CLANS.' WHERE id = ?d';
if($this->oDb->query($sql, $id)) {
return true;
}
return false;
}
public function AddWar($ownerId, $ownerContact, $nameGame, $maps, $server, $serverLocation, $serverPassword, $vscount, $dateadd, $sname)
{
$sql = 'INSERT INTO '.DB_TABLE_CLANS_WARS.'
(owner_id,
owner_contact,
name_game,
maps,
server,
server_location,
server_password,
vscount,
date_create,
status_name
)
VALUES(?d, ?, ?, ?, ?, ?, ?, ?, ?, ?)
';
if($id = $this->oDb->query($sql, $ownerId, $ownerContact, $nameGame, $maps, $server, $serverLocation, $serverPassword, $vscount,$dateadd,$sname))
{
return $id;
}
return false;
}
public function getWars()
{
$sql = 'SELECT * FROM '.DB_TABLE_CLANS_WARS;
if($aRows=$this->oDb->select($sql))
{
return $aRows;
}
return null;
}
public function getWarsByStatus($status,&$iCount,$iCurrPage,$iPerPage)
{
$aWars = array();
switch($status) {
case 'all': break;
case 'agreed': $status = 1; break;
case 'onmod': $status = 2; break;
case 'pas': $status = 3; break;
case 'deleted': $status = 4; break;
default: $status = 0; break;
}
$sql = 'SELECT
cw.*,
c.owner_id,
c.name,
c.name_url,
c.avator,
c.rating,
cr.owner_id,
cr.name as name_rival,
cr.name_url as name_url_rival,
cr.avator as avator_rival,
cr.rating as rating_rival
FROM
'.DB_TABLE_CLANS.' as c,
'.DB_TABLE_CLANS_WARS.' as cw
LEFT JOIN '.DB_TABLE_CLANS.' AS cr ON cr.owner_id = cw.rival_id
WHERE
c.owner_id = cw.owner_id
'.(($status!=='all') ? 'AND cw.status = '.$status : '').'
ORDER BY cw.id DESC
LIMIT ?d, ?d
';
if($aRows=$this->oDb->selectPage($iCount, $sql, ($iCurrPage-1)*$iPerPage, $iPerPage))
{
return $aRows;
}
return null;
}
public function getWarsByIdOwnerClan($owner_id,&$iCount,$iCurrPage,$iPerPage)
{
$aWars = array();
$sql = 'SELECT
cw.*,
c.owner_id,
c.name,
c.name_url,
c.avator,
c.rating,
cr.owner_id,
cr.name as name_rival,
cr.name_url as name_url_rival,
cr.avator as avator_rival,
cr.rating as rating_rival
FROM
'.DB_TABLE_CLANS.' as c,
'.DB_TABLE_CLANS_WARS.' as cw
LEFT JOIN '.DB_TABLE_CLANS.' AS cr ON cr.owner_id = cw.rival_id
WHERE
c.owner_id = cw.owner_id AND
(cw.rival_id = ?d OR cw.owner_id = ?d)
ORDER BY cw.id DESC
LIMIT ?d, ?d
';
if($aRows=$this->oDb->selectPage($iCount, $sql, $owner_id, $owner_id,($iCurrPage-1)*$iPerPage, $iPerPage))
{
return $aRows;
}
return null;
}
public function getWarById($id)
{
$sql = 'SELECT
cw.*,
c.name,
c.name_url,
c.avator,
c.rating,
cr.name as name_rival,
cr.name_url as name_url_rival,
cr.avator as avator_rival,
cr.rating as rating_rival
FROM
'.DB_TABLE_CLANS.' as c,
'.DB_TABLE_CLANS_WARS.' as cw
LEFT JOIN '.DB_TABLE_CLANS.' AS cr ON cr.owner_id = cw.rival_id
WHERE
c.owner_id = cw.owner_id AND
cw.id = ?d';
if($aRows=$this->oDb->selectRow($sql, $id))
{
return $aRows;
}
return null;
}
public function setStatusWar($id_war, $id_status, $name_status, $owner_id=0,$date_confirm=0)
{
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
status = ?d,
status_name = ?'
.($date_confirm ? ',date_confirm ="'.$date_confirm.'"' : '').'
WHERE
id = ?d
'.
($owner_id ? 'and owner_id='.(int)$owner_id.' and rival_id IS NOT NULL and status=0' : '');
if($this->oDb->query($sql, $id_status, $name_status, $id_war)) {
return true;
}
return null;
}
public function WarJoin($id_war, $id_rival, $comment)
{
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
rival_id = ?d,
join_comment = ?
WHERE
id = ?d and
rival_id IS NULL and
owner_id != ?d and
status=0';
if($this->oDb->query($sql, $id_rival, $comment, $id_war, $id_rival))
{
return true;
}
return null;
}
public function WarDeJoin($id_war, $id_rival)
{
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
rival_id = NULL,
join_comment = NULL
WHERE
id = ?d and rival_id = ?d and status=0';
if($this->oDb->query($sql, $id_war, $id_rival))
{
return true;
}
return null;
}
public function WarOwnerDeJoin($id_war, $id_owner)
{
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
rival_id = NULL,
join_comment = NULL
WHERE
id = ?d and owner_id = ?d and status=0';
if($this->oDb->query($sql, $id_war, $id_owner))
{
return true;
}
return null;
}
public function WarDelete($id_war)
{
$time = mktime(0, 0, 0, date("m"), date("d")+COUNT_DAY_DELETE_CLANWARS, date("Y"));
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
deltime = ?
WHERE
id = ?d
';
if($this->oDb->query($sql, $time, $id_war))
{
return true;
}
return false;
}
public function WarDeleteByIdAndOwnerId($id_war, $owner_id)
{
$sql = 'DELETE FROM '.DB_TABLE_CLANS_WARS.'
WHERE
id = ?d AND
owner_id = ?d
';
if($this->oDb->query($sql, $id_war, $owner_id))
{
return true;
}
return false;
}
public function WarsDelete()
{
$sql = 'DELETE FROM '.DB_TABLE_CLANS_WARS.' WHERE status=4 and date_moderated <= ?';
if($this->oDb->query($sql,date("Y-m-d H:i:s",time()-(10*24*60*60)) ))
{
return true;
}
return false;
}
public function WarOwnerComment($id_war, $demo, $comment, $id_owner)
{
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
demo_url_owner = ?,
comment_owner = ?
WHERE
id = ?d and
owner_id = ?d and
demo_url_owner IS NULL and
comment_owner IS NULL and
(status=1 or status=2)';
if($this->oDb->query($sql, $demo, $comment, $id_war, $id_owner))
{
return true;
}
return null;
}
public function WarRivalComment($id_war, $demo, $comment, $id_rival)
{
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
demo_url_rival = ?,
comment_rival = ?
WHERE
id = ?d and
rival_id = ?d and
demo_url_rival IS NULL and
comment_rival IS NULL and
(status=1 or status=2)';
if($this->oDb->query($sql, $demo, $comment, $id_war, $id_rival))
{
return true;
}
return null;
}
public function WarSetWin($id_war, $name_clan_win, $name_clan_lost, $back = false)
{
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
all_games = all_games + 1,
rating = rating + '.RATING_UP_WHEN_VICTORY.',
victories = victories + 1,
effectiveness = 100 / all_games * victories
WHERE
name_url = ?';
if(!$this->oDb->query($sql, $name_clan_win))
{
return false;
}
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
all_games = all_games + 1,
rating = rating - '.RATING_DOWN_WHEN_LESION.',
lesions = lesions + 1,
effectiveness = 100 / all_games * victories
WHERE
name_url = ?';
if(!$this->oDb->query($sql, $name_clan_lost))
{
return false;
}
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
win_clan_name = ?
WHERE
id = ?'.($back ? NULL : ' AND win_clan_name IS NULL');
if($this->oDb->query($sql, $name_clan_win, $id_war))
{
return true;
}
return false;
}
public function WarResetWin($id_war, $name_clan_win, $name_clan_lost)
{
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
all_games = all_games - 1,
rating = rating - '.RATING_UP_WHEN_VICTORY.',
victories = victories - 1,
effectiveness = 100 / all_games * victories
WHERE
name_url = ?';
if(!$this->oDb->query($sql, $name_clan_win))
{
return false;
}
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
all_games = all_games - 1,
rating = rating + '.RATING_DOWN_WHEN_LESION.',
lesions = lesions - 1,
effectiveness = 100 / all_games * victories
WHERE
name_url = ?';
if(!$this->oDb->query($sql, $name_clan_lost))
{
return false;
}
return true;
}
public function GetCountEmptyWarsByOwnerId($id) {
$sql = 'SELECT
COUNT(id) as count
FROM
'.DB_TABLE_CLANS_WARS.'
WHERE
rival_id IS NULL and
owner_id = ?d and
status != 4
';
if($Row = $this->oDb->selectRow($sql, $id))
{
return $Row['count'];
}
return null;
}
public function SetModered($id, $moder_name,$date_moderated)
{
$sql = 'UPDATE '.DB_TABLE_CLANS_WARS.'
SET
modered = ?,
date_moderated=?
WHERE
id = ?d AND
modered IS NULL
';
if($this->oDb->query($sql, $moder_name, $date_moderated, $id))
{
$sql = 'UPDATE '.DB_TABLE_CLANS_MODERATORS.'
SET
modered_count = modered_count + 1
WHERE
moderator_name = ?
';
$this->oDb->query($sql, $moder_name);
return true;
}
return false;
}
public function GetIdTalksByUserIdAndTitle($sendUserId, $title)
{
$sql = 'SELECT
t.talk_id
FROM
'.DB_TABLE_TALK.' as t,
'.DB_TABLE_TALK_USER.' as u
WHERE
t.talk_id = u.talk_id and
t.user_id = ?d and
t.talk_title = ?
';
if($iId = $this->oDb->selectRow($sql, $sendUserId, $title)) {
return $iId['talk_id'];
}
return false;
}
public function GetRelationClanUsers($sUserLogin) {
$sql = "SELECT
id,
name,
name_url
FROM
".DB_TABLE_CLANS."
WHERE
people LIKE BINARY ?
ORDER by id asc;
";
$aClans=array();
if ($aRows=$this->oDb->select($sql,'%'.$sUserLogin.'%')) {
foreach ($aRows as $aClan) {
$aClans[]=new ClansEntity_ClanUser($aClan);
}
}
return $aClans;
}
public function GetClansByOwnerId($iUserId) {
$sql = "SELECT
id,
name,
name_url,
avator
FROM
".DB_TABLE_CLANS."
WHERE
owner_id = ?d
ORDER by id asc;
";
$aClans=array();
if ($aRows=$this->oDb->select($sql,$iUserId)) {
foreach ($aRows as $aClan) {
$aClans[]=new ClansEntity_ClanUser($aClan);
}
}
return $aClans;
}
public function GetClanBanByClanId($sClanId,$iBan) {
$sql = "SELECT
u.user_login,
cb.*
FROM
".DB_TABLE_CLANS_BANS." as cb
JOIN ".DB_TABLE_USER." as u ON u.user_id=cb.moder_id
WHERE
cb.clan_id =?
ORDER by cb.ban_date desc
LIMIT 0, ?d
;
";
$aReturn=array();
if ($aRows=$this->oDb->select($sql,$sClanId,$iBan)) {
foreach ($aRows as $aRow) {
$aReturn[]=new ClansEntity_ClanBan($aRow);
}
}
return $aReturn;
}
public function GetCurrentBanByClanId($iClanId) {
$sql = "SELECT
u.user_login,
cb.*
FROM
".DB_TABLE_CLANS_BANS." as cb
JOIN ".DB_TABLE_USER." as u ON u.user_id=cb.moder_id
WHERE
cb.clan_id =?
AND cb.ban_active=1
ORDER by cb.id desc
LIMIT 1
;
";
if ($aRow=$this->oDb->selectRow($sql,$iClanId)) {
return new ClansEntity_ClanBan($aRow);
}
return null;
}
public function GetRequestByUserId($iUserId) {
$sql = "
SELECT user_id
FROM ".DB_TABLE_CLANS_REQUEST."
WHERE user_id = ?d
";
if($this->oDb->query($sql, $iUserId)) {
return true;
}
return false;
}
public function AddRequestClanCreate(ClansEntity_ClanRequest $oRequest) {
$sql="
INSERT INTO ".DB_TABLE_CLANS_REQUEST."
(user_id,
request_date_add,
request_moderated)
VALUES (?d, ?, ?)";
if($this->oDb->query($sql, $oRequest->getUserId(), $oRequest->getRequestDateAdd(), $oRequest->getRequestModerated())===0) {
return true;
}
return false;
}
public function GetRequestsClanCreate(&$iCount,$iCurrPage,$iPerPage) {
$sql = "SELECT
u.*
FROM
".DB_TABLE_USER." as u
JOIN ".DB_TABLE_CLANS_REQUEST." AS cr ON cr.user_id = u.user_id
WHERE
cr.request_moderated = 0
ORDER BY cr.request_date_add DESC
LIMIT ?d, ?d
";
$aReturn=array();
if ($aRows=$this->oDb->selectPage($iCount,$sql,($iCurrPage-1)*$iPerPage, $iPerPage)) {
foreach ($aRows as $aRow) {
$aReturn[]=new UserEntity_User($aRow);
}
}
return $aReturn;
}
public function GetCountRequestClanCreate() {
$sql = "SELECT count(u.user_id) as count FROM ".DB_TABLE_USER." as u JOIN ".DB_TABLE_CLANS_REQUEST." AS cr ON cr.user_id = u.user_id
WHERE
cr.request_moderated = 0";
$result=$this->oDb->selectRow($sql);
return $result['count'];
}
public function UpdateRequestClanCreate(ClansEntity_ClanRequest $oRequest) {
$sql="
UPDATE ".DB_TABLE_CLANS_REQUEST."
SET
request_moderated = ?
WHERE user_id = ?d
";
if($this->oDb->query($sql, $oRequest->getRequestModerated(), $oRequest->getUserId())) {
return true;
}
return false;
}
public function CheckInviteClan($iUserId) {
$sql = "
SELECT request_moderated
FROM ".DB_TABLE_CLANS_REQUEST."
WHERE user_id = ?d
";
if($aResult=$this->oDb->query($sql, $iUserId)) {
return $aResult['0'];
} else {
return false;
}
}
public function DropInviteClanCreate($iUserId) {
$sql = "
DELETE FROM ".DB_TABLE_CLANS_REQUEST."
WHERE user_id = ?d
";
if($this->oDb->query($sql, $iUserId)) {
return true;
}
return false;
}
public function DropOldRequest($date) {
$sql = "
DELETE FROM ".DB_TABLE_CLANS_REQUEST."
WHERE request_date_add <= ?
AND request_moderated = 0
";
if($this->oDb->query($sql, $date)) {
return true;
}
return false;
}
}
?>ПОМОГИТЕ ИСПРАВИТЬ.Я ЗАПЛАЧУ!!!
Неактивен

rating = rating + 0,05
нужно 0.05
Неактивен
rating = rating + 0,05
немогу найти даже таких строк
vasya помогите я заплачу если что
вот моя icq 411967032
Отредактированно snezhok11 (03.10.2010 21:16:09)
Неактивен

public function WarSetWin($id_war, $name_clan_win, $name_clan_lost, $back = false)
{
$sql = 'UPDATE '.DB_TABLE_CLANS.'
SET
all_games = all_games + 1,
rating = rating + '.RATING_UP_WHEN_VICTORY.',
Ну а где у вас определяется RATING_UP_WHEN_VICTORY это вы определяете сами (тем более, что нее в данном файле)
Вопросы по PHP обсуждаются на webew.ru
Неактивен
vasya
Вам же несложно испарвить ошибку.Вы же разбираетесь.Мой прогер кудато делся,я уже 3-ий день немогу найти человека кто бы мне помог.
я отплачу отпишите мне в icq 411967032
Неактивен
все спасибо проблема решена
Неактивен