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 - MySQL Date comparison advice -


i'm setting script run daily , check members meet age - automated emails can set in cms , assigned sent @ age, either in months or years. handle via php , mysql, number of months passed parameter method, deal below. however, i'm not sure i'm going in easiest way! partly because of formatting of uk date format, i'm converting string datetime unix timestamp make comparison. can find better way of going this? thanks

        // if num of months provided year, make calculation based on exact year         if ($age_in_months % 12 == 0)         {             // using 365 days here (60 * 60 * 24 * 365 = 3153600)             $clause = 'where round((unix_timestamp() - unix_timestamp(str_to_date(dob, "%d/%m/%y"))) / 31536000) = ' . $age_in_months;         }         else          {             // using 30 days avg month length (60 * 60 * 24 = 86400) - convert months days             $clause = 'where round((unix_timestamp() - unix_timestamp(str_to_date(dob, "%d/%m/%y"))) / 86400) = ' . $age_in_months * 30;         }    

  • change column type date or datetime
  • don't use uk date format, use iso-8601 format
  • and index on column

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 -