select a row
#1

i have query like this one



and my code is this one

Код:
	//doublescore weekend 
	{
	new dsquery[40], dsyear, dsmonth, dsday;
	getdate(dsyear, dsmonth, dsday);
	mysql_format(mysql,dsquery,sizeof(dsquery),"SELECT WEEKDAY('%d-%d-%d')",dsyear,dsmonth,dsday);
	mysql_query(mysql,dsquery);
	new dscheck = cache_get_row_int(0,0);
	if(dscheck == 5 && dscheck == 6)
    {
      dsweekend = 1;
    }
    else dsweekend = 0;
    printf("[DOUBLESCORE_WEEKEND]Date : %d-%d-%d : Weekday: %s : Active : ",dsyear,dsmonth,dsday,dscheck,dsweekend);
	}
but i get this one instead of the date's index....

Код:
[17/11/2016 06:30:33] [MYSQL] Connection with the database: SUCCESS!
[17/11/2016 06:30:33] ----------------------------------------------------- 
[17/11/2016 06:30:33] [DOUBLESCORE_WEEKEND]Date : 2016-11-17 : Weekday: аSELECT WEEKDAY('2016-11-17') : Active : 
[17/11/2016 06:30:33]   
[17/11/2016 06:30:33] BFScript is loaded. By Slawi, Mr.Moon, Kiets & DetoNater.

[17/11/2016 06:30:33]   
[17/11/2016 06:30:33] Number of vehicle models: 56
Reply
#2

How is it possible for dscheck to be both 5 and 6 at the same time. Another thing is that it is an integer thus %d or %i specifier, you've used %s for strings.

If you are to use non-threaded queries, delete the cache from memory to avoid memory leaks: https://sampwiki.blast.hk/wiki/MySQL/R33#cache_delete
Reply
#3

-Fixed- thank you, and can you give example of cache_delete?? for the above function, i dont know which is the cache_id
Reply
#4

An example is shown here: https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_query
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)