Little help with float+mysql
#1

Hello everybody.

I created a simple system in my gamemode and I need to get a float point, but this code don't works:

pawn Код:
static Float:get_float;
cache_get_field_content(0, "pX", get_float, mysql_handle); EmpInfo[0][E_pX] = Float:get_float;
Someone help-me please? I am beginner with mysql.. thanks
Reply
#2

Use floatstr();
Reply
#3

Quote:
Originally Posted by Mr_DjolE
Посмотреть сообщение
Use floatstr();
I've used this, but I get errors with mismatch.

Just for remember, 'pX' I put the type: Float on the phpmyadmin
Reply
#4

Why you don't use cache_get_row(); ?
Reply
#5

Because 'cache_get_field_content' have the same function of cache_get_row ...
Reply
#6

Quote:
Originally Posted by Carlґ
Посмотреть сообщение
Because 'cache_get_field_content' have the same function of cache_get_row ...
I've solved my problem by using cache_get_row. Give it a try.
Reply
#7

you have to store the field content into a string, and THEN convert it into a float using floatstr()

pawn Код:
new content[10];
cache_get_field_content(0, "pX", content, mysql_handle); EmpInfo[0][E_pX] = floatstr(content);
Reply
#8

- delete nvm.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)