Writing and Displaying Strings From a DB
#1

I am having issues with writing a string to the DB. It also will not display (possibly even load) correctly.

When I write an integer, it works and displays correctly.









Reply
#2

That's because cache_get_field requires a max_len, which it cannot properly calculate if the variable is in an enum.
Reply
#3

How would I fix this?
Reply
#4

Bump. Dump. Trump.
Reply
#5

Add a maximum length.... Look at these cache functions (if you're using R8)
pawn Код:
// Cache functions.
native cache_get_data(&num_rows, &num_fields, connectionHandle = 1);
native cache_get_field(field_index, destination[], connectionHandle = 1, max_len=sizeof(destination));
native cache_get_row(row, idx, destination[], connectionHandle = 1, max_len=sizeof(destination));
native cache_get_row_int(row, idx, connectionHandle = 1);
native Float:cache_get_row_float(row, idx, connectionHandle = 1);
native cache_get_field_content(row, const field_name[], destination[], connectionHandle = 1, max_len=sizeof(destination));
native cache_get_field_int(row, const field_name[], connectionHandle = 1);
native Float:cache_get_field_float(row, const field_name[], connectionHandle = 1);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)