1

Topic: I ask the help with the code

At once I will make a reservation, I a teapot, but try to understand). There is a site - a show-window of banners. The problem that digit "0" in line an amount of the viewed banners even if I in basis will correct on invented number is permanently shown, all the same in flow of hour is dropped on "0". This total is caused from a column "show_advert_24"
I so understand here the code which edits the total of shows:

if (TIME - strtotime ($obEngine-> getConfig (' time_update '))> 3600)
{
$show_advert_24 = $mysqli-> query ("SELECT SUM (view) as view FROM `".PREFIX. "_ blocks_view ` WHERE ` time_add `> = (CURDATE ()-1) and ` time_add ` <CURDATE ()")-> fetch_assoc () [' view '];
$mysqli-> query ("UPDATE `".PREFIX. "_ config ` SET ` time_update ` = NOW (), ` show_advert_24 ` = '". $show_advert_24. "' WHERE ` id ` = ' 1 '");
}

- The first line is responsible for column comparing time_update and if transited hour launches change of shows in "show_advert_24"
- In the second line to value "show_advert_24" the total of shows view from the table "_blocks_view" for the last days is appropriated
- In the third value "show_advert_24" registers in basis
But this value registers always "0" though in the table "_blocks_view" in a column view records are, them more than 20000 pieces.
Prompt where the error crept in? What not so considers?
I thank for the help.

2

Re: I ask the help with the code

In  with such questions...