以下TO_DAYS语句返回非常大的负值,例如-3.9084128648E11
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.drawer_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.menu_go_home:
String itemTitle = item.getTitle();
Constant.CATEGORY_URL = SERVER_URL+"api.php? + itemTitle;
return true;
default:
return super.onOptionsItemSelected(item);
}
}
s。 enroll_start是MySQL DATE数据类型。 结果看起来像(请注意
Warning : file_get_contents(htp://www.easyphp.org/myipadress.php);
in C:\Program Files (x86)\EasyPhP-Webserver14.1b2\dashboard\index.php
on line 303
Port:10000
,当尝试在enrollStart和curdate()之间进行DATEDIFF时,会看到类似的结果。 SELECT...,
s.enroll_start as enrollStart,
TO_DAYS(s.enroll_start) as enrollStartToDays
FROM...
WHERE...
尤其奇怪的是,通过Navicat或SQL Explorer运行查询时,永远不会发生此问题。它仅在Web应用程序内发生,即使那样也不会持续发生。