Changeset 8333 for trunk/MagicSoft/Mars/datacenter/db/include.php
- Timestamp:
- 02/26/07 12:59:57 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/include.php
r8199 r8333 223 223 224 224 return $max; 225 } 226 227 function GetMaxDate($field, $table, $host, $user, $pw, $db) 228 { 229 $db_id = mysql_connect($host, $user, $pw); 230 if ($db_id==FALSE) 231 { 232 printf("mysql_connect returned the following error:<br>"); 233 printf("%s<br>", mysql_error()); 234 die(""); 235 } 236 237 $query = "SELECT DATE_FORMAT(if(MAX(" . $field . ")<'13:00:00', MAX(" . $field . "), ADDDATE(MAX(" . $field . "), INTERVAL +1 DAY)), '%Y-%m-%d') FROM " . $db . "." . $table; 238 $result = mysql_query($query); 239 if (!$result) 240 return "0"; 241 242 $row = mysql_fetch_row($result); 243 244 $maxdate = $row[0]; 245 246 mysql_free_result($result); 247 mysql_close($db_id); 248 249 return $maxdate; 225 250 } 226 251
Note:
See TracChangeset
for help on using the changeset viewer.