[MySQL] How to use the mysql_fetch_field_row to float?
#1

Hello everyone !
Well I'm using the mysql plugin (http://forum.sa-mp.com/index.php?topic=79352.0) I am not able to put get data that are float or integer with mysql_fetch_field_row(error) ...
Do you have any that I can use in place of it?
thanks
Reply
#2

If you select only one field which is float or integer ("SELECT float WHERE blabla" or "SELECT number WHERE blabla") you do it like this:

pawn Код:
mysql_query("SELECT somefloat WHERE me='Im cool');
mysql_store_result();

new integer = mysql_fetch_int();

new Float:float
mysql_fetch_float(float)

mysql_free_result();
However if you select more fileds and you want to extract floats use floatstr, if you want to extract integers use strval. You can also use sscanf insteaf of strval or floatstr.


And next time post in plugin's topic instead of making new one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)