Jump to content
  • 0

Nu se salveaza data inregistrarii corect in MySQL


HeRR0

Question

Salut, dupa cum vedeti in titlu, aceea este problema. Eu folosesc ultima versiune de mysql.

Unde ar putea fi problema:

	new d,m,y;
	getdate(y,m,d);
	new h,mine,s;
	gettime(h,mine,s);
	format(gString,sizeof(gString),  "%d/%d/%d %d:%d:%d",d,m,y,h,mine,s);
	strmid(PlayerData[playerid][pRegistredDate], gString, 0, strlen(gString), 255);
	UpdatePlayerData(playerid, pRegistredDatex);

sau problema este la:

cache_get_value_name_int(0, "RegisterDate", PlayerData[playerid][pRegistredDate]);

Linia in MySQL este asa facuta:

`RegisterDate` varchar(50) NOT NULL DEFAULT '01/01/1970 01:01:01',

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Sunt destul de sigur ca mysql are functii pentru data/ora intergrate. In loc de gettime /getdate incearca sa bagi direct in mysql functia  NOW(). (la VALUES in loc de %s sau %d pui functia).

 

EDIT: Field-ul in care e inregistrata data ar trebui sa fie timestamp, poti sa cauti pe .com despre timestamp , mysql register date si o sa gasesti un raspuns mai detaliat / corect.

Edited by CritteR
Link to comment
Share on other sites

  • 0

Se salveaza, dar tu cand incarci datele nu le incarci bine, RegisterDate e un string nu int folosesti functia de cache gresita

cache_get_value_name in loc de cache_get_value_name_name

Dar raspunsul de mai sus este mai bun

Edited by Banditul
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.