Dede SQL statement execution, when the query statistics result is 0 o'clock, does not output any value, when the data is normal.
The workaround is to determine if the statistic result is empty, and the statistic field value is reset for null.
The code is as follows: When the statistics are published today, if not, the output is none, and the number of output statistics.
{dede:sql sql= ' select COUNT (*) as mycount from Dede_archives where typeid=24 and pubdate > Unix_timestamp (curdate ()) '}
[Field:mycount runphp= ' yes ']
if (empty (@me)) {
@me = "None";
}
[/field:mycount]
{/dede:sql}
Note:
[Field:mycount runphp= ' yes '] for field information, to be processed, @me represent the value of the current field, modify the return value, the direct assignment @me can be.
The Echo output value of this code snippet is not printed in the foreground, but in the background build interface.
Dedecms an empty SQL query for an output value