SA-MP Forums Archive
mysql - 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: mysql (/showthread.php?tid=656136)



mysql - Suikast - 08.07.2018

what is the Problem?

Код:
[10:15:49 07/08/18] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('2') (Query: "SELECT *, DATE_FORMAT(lastlogin, '%D of %M, %Y @ %k:%i') AS login_date FROM users WHERE username = 'Bradley_Manzoni' AND password = 'C246AE89E88004BA4C2A92F46A814024C10DFF3FD1433C78B25912034DC64EC50C18CF86299E86D8C04A8DAAF367F021D2B69AFFEB95351AEDDC951E5F88A264'")
[10:15:49 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype
[10:16:49 07/08/18] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('100') (Query: "SELECT * FROM vehicles WHERE ownerid = 177 LIMIT 3, 1")
[10:16:49 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype
[10:40:05 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype
[10:40:05 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype
[10:42:02 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype
[10:42:02 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype
[10:56:33 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype
[10:56:33 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype
[12:26:59 07/08/18] [ERROR] cache_get_field_content_int - invalid datatype



Re: mysql - CodeStyle175 - 08.07.2018

what is this even?


Re: mysql - Suikast - 09.07.2018

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
what is this even?
ist mysql_log i have These Errors and i dont know how to fixx


Re: mysql - Calisthenics - 09.07.2018

A table has 5 columns: a, b, c, d, e
If you do:
pawn Код:
SELECT *, DATE_FORMAT(...) as login_date ...
row indexes 0, 1, 2, 3, 4 are reserved to * (all, five of them)
row index 6 is login_date

If you do not remember what column is first, what is second and so on, you can retrieve by its name. Make sure the datatype is correct. This means, if column is VARCHAR you cannot use cache_get_value_int to retrieve it as integer.

100 columns in vehicles table? way too many. Optimize database structure as well.

For more information, you will need to post the code you load the data with these queries.


Re: mysql - Suikast - 10.07.2018

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
A table has 5 columns: a, b, c, d, e
If you do:
pawn Код:
SELECT *, DATE_FORMAT(...) as login_date ...
row indexes 0, 1, 2, 3, 4 are reserved to * (all, five of them)
row index 6 is login_date

If you do not remember what column is first, what is second and so on, you can retrieve by its name. Make sure the datatype is correct. This means, if column is VARCHAR you cannot use cache_get_value_int to retrieve it as integer.

100 columns in vehicles table? way too many. Optimize database structure as well.

For more information, you will need to post the code you load the data with these queries.

i have this at Code

Код:
				mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT *, DATE_FORMAT(lastlogin, '%s') AS login_date FROM users WHERE username = '%s' AND password = '%s'", specifiers, GetPlayerNameEx(playerid), password);
	        	mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_PROCESS_LOGIN, playerid);