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.

getting JSON data-tree from MySQL -


i have newsfeed similar facebook's newsfeed.

it means need not "straight" rows & cols datasets mysql more "trees" of data different length of branches (and different contents).

if go straight end lots of nested cycles in php - because each type of news needs different data sets.

example of newsfeed: 1) user "a" has added 2 new images (here have user_name, user_avatar, image_path_1, image_path_2 etc..) 2) user "b" has commented users's "a" image (here need user's "b" name, user's "b" avatar, image_path, comment_text, user's "a" name etc...)

see mean?

so want data mysql stored procedure converted json format.

{"news":              [                {news_type: "new_images", user_name: "john", user_avatar: "0002.jpg", image_path: "/images/00123.jpg"}                {news_type: "comment", user_name: "john", user_avatar: "0002.jpg", comment: "hello!"}             ]       } 

i can conversion in mysql "concat" , "group_concat"... want ask opinion if it's idea or not - , if not better way.

thanks help!

update switched mongodb :)

this not wise. should use database server database work.

php automatically json encoding json_encode() if pass associative array. no point reinventing wheel or bogging down database server.


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 -