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 - Table cells flushed white -


upon running below sql statement (which works perfectly) i've found tables in database flushed white.

any idea why happening?

        // check database necessary updates  $update = mysql_query("select * rent colour='3c0'");  while($row_update = mysql_fetch_array( $update )) {  $datetime_lower   = datetime::createfromformat('d/m/y', $min); $datetime_upper   = datetime::createfromformat('d/m/y', $max); $datetime_compare = datetime::createfromformat('d/m/y g:i a', $row_update['pdate']);  if ($datetime_lower < $datetime_compare && $datetime_upper > $datetime_compare) {      // date between nothing          mysql_close($update);      } else {      // date not between update      echo "date not between";      $update_result = mysql_query("update rent set colour='f0f0f0' substr(pdate, 0, 10) not between $min , $max && colour='3c0'");      mysql_close($update_result); } } 

i've included few pictures.

this how meant (above code omitted):

http://i51.tinypic.com/143gpef.jpg

this how looks (above code present):

http://i54.tinypic.com/2lwm4xg.jpg

your while loop appears go through results table. appears on each iteration of loop, check date first in php, check date again in update query, , update matching rows f0f0f0.

i don't know why code changing colour white instead of #f0f0f0, since there no white or fff in code, can suggest make code more efficient.

instead of updating rows on each iteration of while loop, if have id column (primary key auto-increment) in rent table, can use value in while loop instead of having test date second time.

$update = mysql_query("select * rent colour='3c0'"); while($row_update = mysql_fetch_array( $update )) {     $datetime_lower   = datetime::createfromformat('d/m/y', $min);     $datetime_upper   = datetime::createfromformat('d/m/y', $max);     $datetime_compare = datetime::createfromformat('d/m/y g:i a', $row_update['pdate']);     if ($datetime_lower < $datetime_compare && $datetime_upper > $datetime_compare) {         // date between nothing         mysql_close($update);     } else {         // date not between update         echo "date not between";         $update_result = mysql_query("update rent set colour='f0f0f0' id=" . $row_update['id'] . " && colour='3c0'");         mysql_close($update_result);     } } 

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 -