Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

php - Recursive-ish query for tags? -


i have table of tags can linked other tags , want "recursively" select tags in order of arrangement. when search made, immediate (1-level) results , carry on down 5-levels have list of tags no matter if there wasn't enough exact matches on level 1.

i can manage fine making multiple queries until enough results, surely there better, optimized, way via one-trip query?

any tips appreciated. thanks!

results:

tagid, tagword, child, child tagid '513', 'slap', 'hog slapper', '1518' '513', 'slap', 'corporal punishment', '147' '513', 'slap', 'impact play', '1394' 

query:

select t.tagid, t.tagword tag, tt.tagword child, tt.tagid childid  platform.tagwords t  inner join platform.tagslinks l on l.parentid = t.tagid inner join platform.tagwords tt on tt.tagid = l.tagid  t.tagword = 'slap' 

table layouts:

mysql> explain tagwords; +---------+---------------------+------+-----+---------+----------------+ | field   | type                | null | key | default |          | +---------+---------------------+------+-----+---------+----------------+ | tagid   | bigint(20) unsigned | no   | pri | null    | auto_increment | | tagword | varchar(45)         | yes  | uni | null    |                | +---------+---------------------+------+-----+---------+----------------+ 2 rows in set (0.00 sec)  mysql> explain tagslinks; +----------+---------------------+------+-----+---------+-------+ | field    | type                | null | key | default | | +----------+---------------------+------+-----+---------+-------+ | tagid    | bigint(20) unsigned | no   |     | null    |       | | parentid | bigint(20)          | yes  |     | null    |       | +----------+---------------------+------+-----+---------+-------+ 2 rows in set (0.00 sec) 

afaik mysql doesn't have mechanism querying data recursively

oracle has connected by construct , sql server has cte(common table expressions).

but mysql, read here , here


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -