Originally Posted by BFBombi
Okey, i tryed it but where is my error ?
your logic is borked in several places:
You never set BaseDate, so it is always 0, therefore your print output in CheckDate() is always '...(in unixtime): 0'.
But you don't want to print in there to begin with, because you are using a threaded query, which means you won't have the results ready after calling CheckDate, but only after T_CheckDate has been called. Only then you could use your results e.g. to print them.
Format(query, sizeof(query), "SELECT last_date FROM users WHERE last_date = '%i'", BaseDate);
SQL_TQuery(Database, T_CheckDate, query, client);
Again, BaseDate is not set and you select the attribute you are querying against in the first place, so your sql query could be read as: "Select 0". Well almost. You will get a number of rows all with the result 0, if there are any rows in your table with last_date = 0.
I also thought you wanted to check how many days a certain user has left, so your query should rather be sth like this:
"select last_date FROM users WHERE steamid = 'STEAM_0:1:12314'
Furthermore you'll never do anything with the result you get from the database (which you should do in T_CheckDate()).
As a principal hint: Don't try to do everything at once, but start slow and grow your code. So you first want to have the correct SQL query, use phpMyAdmin or whatever you are comfortable with to create and test your query. If you are getting the results you want (steamid + last_date), proceed to your plugin and use non-threaded queries. If those work, rewrite your code to use threaded queries.
You are currently trying to do all at the same time, which is bound to fail if you are new to all of them.