Changeset 366 for trunk/dictionary.php


Ignore:
Timestamp:
Mar 9, 2010, 1:01:14 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Přejmenovány všechny tabulky textů na názvy s prvními velkými písmeny ve slovech plus pro odlišení s prefixem Text.
  • Upraveno: Další SQL dotazy doplněny o SQL uvozovky.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dictionary.php

    r365 r366  
    4141  foreach($TablesColumn as $Table => $Column)
    4242  { 
    43     $sql = 'SELECT `ID`,'.$Column.',(SELECT `Name` FROM '.$Table.' AS `T` WHERE `O`.`entry` = `T`.`entry` AND `Language` <> 0 LIMIT 1) AS `tran` FROM `'.$Table.'` AS `O` WHERE ';
     43    $sql = 'SELECT `ID`,'.$Column.',(SELECT `Name` FROM '.$Table.' AS `T` WHERE `O`.`Entry` = `T`.`Entry` AND `Language` <> 0 LIMIT 1) AS `Tran` FROM `'.$Table.'` AS `O` WHERE ';
    4444    $groupby = ' GROUP BY `'.$Column.'`';
    4545 
    4646    $ArrStr = explode(' ', $Text);
    47     $where = 'Language = 0 ';
    48     if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = O.entry))';
    49     if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = O.entry))';
     47    $where = '`Language` = 0 ';
     48    if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0) AND (`Sub`.`Entry` = `O`.`Entry`))';
     49    if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0) AND (`Sub`.`Entry` = `O`.`Entry`))';
    5050    $where .= ' AND (';
    5151 
Note: See TracChangeset for help on using the changeset viewer.