remox
Новичок
Дата регистрации:
24.06.2013 21:42:40
Сообщений: 2
прошу помощи в таком деле, как расставление кавычек в запросах-исправить где не так и доставить где нету
раз
$q = "SELECT `u.protect` FROM `".TB_PREFIX."users` u,`".TB_PREFIX."vdata` v WHERE `u.id`='v.owner' AND `v.wref`=".$vid;
два
$q = "SELECT `u.id`,`u.tribe`,`v.capital`,`f.f40` AS `wall` FROM `".TB_PREFIX."users` u,`".TB_PREFIX."fdata` f,`".TB_PREFIX."vdata` v WHERE `u.id`=`v.owner` AND `f.vref`=`v.wref` AND `v.wref`='".$vid."'";
три
$q = "SELECT sum(`pop`) AS `pop` FROM `".TB_PREFIX."vdata` WHERE `owner`='".$uid."'";
4
$q = "SELECT a.wref, a.name, b.x, b.y from `".TB_PREFIX."vdata` AS a left join `".TB_PREFIX."wdata` AS b ON b.id = a.wref where `owner` = '".$uid."' order by `capital` DESC,`pop` DESC";
п'ять
$dbarray = $this->query_return("SELECT e.*,o.`conqured`,o.`owner` FROM `".TB_PREFIX."enforcement` as e LEFT JOIN `".TB_PREFIX."odata` as o ON e.`vref`=o.`wref` where o.`owner`='".$uid."' AND e.`hero`>'0'"
шесть
$q = "SELECT * FROM `".TB_PREFIX."movement`, `".TB_PREFIX."attacks` where ".TB_PREFIX."movement.`from` = '$wref' and ".TB_PREFIX."movement.`to` = '$toWref' and ".TB_PREFIX."movement.`ref` = ".TB_PREFIX."attacks.`id` and ".TB_PREFIX."movement.`proc` = '0' and ".TB_PREFIX."movement.`sort_type` = '3' and (".TB_PREFIX."attacks.`attack_type` = '3' or ".TB_PREFIX."attacks.`attack_type` = '4' ORDER BY `endtime` ASC";
7
$q = "SELECT * FROM `".TB_PREFIX."movement`, `".TB_PREFIX."attacks` where ".TB_PREFIX."movement.`from` = '$wref' and ".TB_PREFIX."movement.`to` = '$toWref' and ".TB_PREFIX."movement.`ref` = ".TB_PREFIX."attacks.`id` and ".TB_PREFIX."movement.`proc` = '0' and ".TB_PREFIX."movement.`sort_type` = '3' and ".TB_PREFIX."attacks.`attack_type` = '2' ORDER BY `endtime` ASC";
хотя можно и 2-3, а дальше я уже сам розберусь) спасибо)