DATE_FORMAT null - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: DATE_FORMAT null (
/showthread.php?tid=633916)
DATE_FORMAT null -
vernz - 09.05.2017
So, I have this query
PHP код:
mysql_format(sqlConnection, query, sizeof(query), "SELECT *, DATE_FORMAT(lastlogin, '%%e/%%c/%%Y') AS date_time FROM players WHERE username = '%e' AND password = '%e'", GetPlayerNameEx(playerid), password);
mysql_tquery(sqlConnection, query, "OnQueryFinished", "ii", THREAD_ACCOUNT_LOGIN, playerid
PHP код:
new date[64];
cache_get_field_content(0, "date_time", date, sqlConnection, 64);
PHP код:
SendClientMessageEx(playerid, -1, "Your last login was on the %s", date);
it shows me NULL when the player spawn, I'm not sure what is wrong with it, any ideas ?
Re: DATE_FORMAT null -
Vince - 09.05.2017
Print the query. I suspect the mysql_format function is getting confused with those extra percent signs.
Re: DATE_FORMAT null -
vernz - 09.05.2017
PHP код:
SELECT *, DATE_FORMAT(lastlogin, 'e/
also
PHP код:
[15:13:28 05/09/17] [WARNING] CMySQLResult::GetRowDataByName - field not found ("date_time") (Query: "SELECT * FROM players WHERE id = 4 LIMIT 1")
Re: DATE_FORMAT null -
vernz - 09.05.2017
PHP код:
specifiers[] = "%%D of %%M, %%Y @ %%k:%%i";
PHP код:
mysql_format(sqlConnection, query, sizeof(query), "SELECT *, DATE_FORMAT(lastlogin, '%e') AS date_login FROM players WHERE username = '%e' AND password = '%e'", specifiers, GetPlayerNameEx(playerid), password);
print:
PHP код:
SELECT *, DATE_FORMAT(lastlogin, '%D of %M, %Y @ %k:%i') AS date_login FROM players WHERE username = etc...
No values assign to it ?
Re: DATE_FORMAT null -
vernz - 11.05.2017
bump
Re: DATE_FORMAT null -
Jefff - 11.05.2017
Show more info, database screenshot with lastlogin type and create table