String does not get sent to mysql properly
#3

Quote:
Originally Posted by Mister0
Посмотреть сообщение
the error is here
PHP код:
 mysql_format(SQLlongstring1024"UPDATE `users` SET `mcrimes`='%d' WHERE `ID`='%d' LIMIT 1"longstringPlayerData[id][ID]); 
    
mysql_tquery(SQLlongstring""""); 
yopu need to put '%s' not %d
PHP код:

 mysql_format
(SQLlongstring1024"UPDATE `users` SET `mcrimes`='%s' WHERE `ID`='%d' LIMIT 1"longstringPlayerData[id][ID]); 
    
mysql_tquery(SQLlongstring""""); 
Thanks +rep that helped me get some data into the database but i have another problem now. The string does not get formatted like i want it to.

On player connect i get their old crimes string like this
PHP код:
    cache_get_field_content(0"mcrimes"PlayerData[playerid][mcrimes], SQL129); 
And then when insercrime is called i do:

PHP код:
    format(longstringsizeof(longstring), "%s"PlayerData[playerid][mcrimes]);
    
    
format(longstringsizeof(longstring), "%s\n%s: %s - %s"longstringdatereasonPlayerData[playerid][Name]);
    
mysql_format(SQLlongstring1024"UPDATE `users` SET `mcrimes`='%s' WHERE `ID`='%d' LIMIT 1"longstringPlayerData[id][ID]);
    
mysql_tquery(SQLlongstring"""");
    
strmid(PlayerData[playerid][mcrimes], longstring0strlen(longstring), 1024); 
The problem i have is that i never get to insert multiple crimes just the first one goes into the database the next ones don't get formatted like this: %s\n%s: %s - %s
Reply


Messages In This Thread
String does not get sent to mysql properly - by gumball3000 - 27.02.2016, 14:15
Re: String does not get sent to mysql properly - by Mister0 - 27.02.2016, 14:30
Re: String does not get sent to mysql properly - by gumball3000 - 28.02.2016, 08:57
Re: String does not get sent to mysql properly - by gumball3000 - 28.02.2016, 12:57

Forum Jump:


Users browsing this thread: 1 Guest(s)