- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
define('QUERY_CITY_UPD_CITY_NUMBERS',"replace into ".CONFOBJECT_DB_TABLE_CITY_NUMBERS." set users=#users#,anketas=#anketas#,oid=#oid#,region_id=#region_id#,country_id=#country_id#");
define('QUERY_CITY_PURGE_CITY_NUMBERS',"delete from ".CONFOBJECT_DB_TABLE_CITY_NUMBERS." where oid not in (#cities#)");
define('QUERY_CITY_DEL_CITY_NUMBERS',"DELETE FROM ".CONFOBJECT_DB_TABLE_CITY_NUMBERS." WHERE oid=#city_id# AND region_id=#region_id# AND country_id=#country_id#");
define('QUERY_CITY_GET_CITY_CODES','SELECT SQL_CALC_FOUND_ROWS * FROM '.CONFOBJECT_DB_TABLE_CITY_CODES.' WHERE country_id=#country_id# AND region_id=#region_id# AND city_id=#city_id# #add_where# ORDER BY operator_id, code LIMIT #offset#,#limit# ');
define('QUERY_CITY_INS_CITY_CODES','INSERT INTO '.CONFOBJECT_DB_TABLE_CITY_CODES.' (country_id,region_id,city_id,operator_id,fdigit,code) VALUES (#country_id#,#region_id#,#city_id#,#operator#,#fdigit#,"#code#")');
define('QUERY_CITY_SET_CITY_CODES','UPDATE '.CONFOBJECT_DB_TABLE_CITY_CODES.' SET operator_id=#operator#,fdigit=#fdigit#,code="#code#" WHERE id=#id#');
define('QUERY_CITY_DEL_CITY_CODES','DELETE FROM '.CONFOBJECT_DB_TABLE_CITY_CODES.' WHERE id IN (#id#)');
define('QUERY_CITY_DEL_CITY_CODES_MASS','DELETE FROM '.CONFOBJECT_DB_TABLE_CITY_CODES.' WHERE #operator# country_id=#country_id# AND region_id=#region_id# AND city_id=#city_id# #code#');
define('QUERY_CITY_DEL_CITY_CODES_OPERATOR','UPDATE '.CONFOBJECT_DB_TABLE_CITY_CODES.' SET operator_id=0 WHERE operator_id=#operator_id#');
define('QUERY_CITY_CHANGING_LOCATION','UPDATE '.CONFOBJECT_DB_TABLE_CITY.' SET #set_list# WHERE #where_list#');
define('QUERY_CITY_NUMBERS_CHANGING_LOCATION','UPDATE '.CONFOBJECT_DB_TABLE_CITY_NUMBERS.' SET #set_list# WHERE #where_list#');
и так 400 строк кода, где запросы к БД хранятся в константах
guest 16.04.2009 14:16 # 0
guest 16.04.2009 16:31 # 0
Напомнило творчество товарища, который на каждую из 200+ таблиц в проекте сделал отдельный класс.
guest 17.04.2009 16:31 # 0
2Kitsch:
А может не сделал отдельный класс, а просто нагенерил по ддл?
guest 20.04.2009 18:40 # 0
guest 22.04.2009 20:49 # 0
Я тоже на каждую таблицу завожу свой класс, не вручную конечно.
guest 04.05.2009 10:33 # 0
очень похоже на исходники самого известного ру дейтинга
guest 25.06.2009 22:30 # 0