MySQL doesn't save a long string.
#1

So I try to log player chat at OnPlayerText and temporarily upped all the values to 500, yet it still doesn't save the large string, only a part of it.

Anyone knows why? See code and screenshot below.

MySQL:


Table:


In-Game:


PHP Code:
public OnPlayerText(playeridtext[])
{
    if(!
gamemodeLoaded)
    {
        
SCM(playeridCOLOR_ERROR"Please wait until the gamemode finishes loading.");
        
SCM(playeridCOLOR_SERVER"Your request was not processed.");
        return 
0;
    }
    if(!
LoggedIn[playerid] || Spawned[playerid] == 0)
    {
        
SCM(playeridCOLOR_ERROR"You are not logged in or have not spawned yet.");
        
SCM(playeridCOLOR_SERVER"You must login and spawn first before your request can be processed.");
        return 
0;
    }
    new 
str[500];
    if(
AdminDuty[playerid] == 1)
    {
        
format(strsizeof(str), "(( %s %s(%i): %s ))",ReturnAdminLevel(playerid), ReturnICName(playerid), playeridtext);
        
ProxDetector(20.0playeridstrCOLOR_ORANGE);
    }
    else if(
DevDuty[playerid] == 1)
    {
        
format(strsizeof(str), "(( %s %s(%i): %s ))",ReturnDevLevel(playerid), ReturnICName(playerid), playeridtext);
        
ProxDetector(20.0playeridstrCOLOR_DEV);
    }
    else
    {
        
format(strsizeof(str), "%s says: %s"ReturnICName(playerid), text);
        
ProxDetectorColor(20.0playeridstrCOLOR_GRAD1COLOR_GRAD2COLOR_GRAD3COLOR_GRAD4COLOR_GRAD5);
        
SetPlayerChatBubble(playeridstrCOLOR_CHAT305000);
    }
    new 
query[500];
    
mysql_format(g_SQLquerysizeof(query), "INSERT INTO logs_chat(acc_dbid, acc_name, playerid, time, text) VALUES('%i', '%e', '%i', UTC_TIMESTAMP(), '%e')"PlayerInfo[playerid][pDBID], ReturnName(playerid), playeridtext);
    
mysql_tquery(g_SQLquery);
    return 
0;

Reply
#2

That is just how phpMyAdmin works. Notice the three dots at the end of the field? This means the string was cut for displaying purposes (so it can be compact). If you double click the field you will enter editing mode for that field and will see the full string.
Reply
#3

Quote:
Originally Posted by bgedition
View Post
That is just how phpMyAdmin works. Notice the three dots at the end of the field? This means the string was cut for displaying purposes (so it can be compact). If you double click the field you will enter editing mode for that field and will see the full string.
If I double click it I just select the text, and if I try to search for the part of the string that comes after the dots, nothing is found. I also tried dragging the field to make it longer but it doesn't show the new text. I clicked edit at the top and it doesn't show anything either.

If I double click:



If I search for part of the string that comes after the dots:


Also notice I made the field longer by dragging it and additional text did not show.

As far as I'm aware, I'm not editing the column when I double click it, I just select it.

Please help
Reply
#4

Found settings which let me increase the size. If anyone else has this issue, this is how to solve it:

Go to options here:


Then increase size here:


Hope that helps others that get this issue!
Reply
#5

You realize you cant type more than 128 characters in chat right?

https://san-andreas-multiplayer-samp...om/wiki/Limits
Reply
#6

Quote:
Originally Posted by Banditul18
View Post
You realize you cant type more than 128 characters in chat right?

https://san-andreas-multiplayer-samp...om/wiki/Limits
Yes, obviously.. But a player can type 128 characters when they press T. With their name added though, it cuts down, that's why you need a second line to continue the string.
Reply
#7

Sorry about the double click thing. It only works when a table has a primary key.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)