MySQL storing strings
#1

Hello everyone, so I've made a notes system.. and in the notes table, I added "NoteText".
I store the "NoteText" in a variable, but the variable returns "NULL", not the text of the note.

Here's the code:
PHP код:
forward ViewNotesFunc(playerid);
public 
ViewNotesFunc(playerid)
{
    new
        
rows,
        
fields;
    
cache_get_data(rowsfieldsmysql);
    
    if(
rows)
    {
        new 
string[128], vipnotenoteidnotetext[30];
        for(new 
0rowsi++)
        {
            
noteid cache_get_row_int(i0);
            
cache_get_row(i4notetext);
            
vipnote cache_get_row_int(i3);
            
format(stringsizeof(string), "Note ID: %d || VIP Note: %d || Note text: %s"noteidvipnotenotetext);
            
SendServerMSG(playeridstring);
        }
    }
    else
    {
        
SendErrorMSG(playerid"This player doesn't have any note.");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)