MySQL_GetFloat, is this correct?
#3

Quote:
Originally Posted by AndreT
Посмотреть сообщение
No.

Your problem is that mysql_fetch_int() returns an integer, not a float. This means you lose floating point precision.

Another problem here is that this approach is absolutely disgusting - a function which will run a query for every value you wish to obtain? I have seen this before, but in 2008 in large roleplay gamemodes. Back when the scripters there had close to zero idea how to nicely implement database interactions because MySQL was just a small rising trend among us.

Now times are different, you have plenty of quite powerful MySQL plugins to operate with, Dan's and BlueG's just to mention two (latter is being maintained by Pain123 though). And queries like that often aren't supported anymore, and I don't see why they should be.

If you want some more ideas on how to interact with databases (and why and how to do it at once for the data that you need obtained instead of querying for it every time you need one value), see the link in my signature.
Thank you for the assistance, but you need to chill out.

1. I'm learning to script so by referring to a method as 'absolutely disgusting' is highly disrespectful.
2. Why make things difficult when you can make them easy?
3. I've no idea how to use those items you listed as it's not the way I learned.
4. I asked a simple question and it has no effect on who I am or what I do, therefore I don't need a lecture about trends or what you think.
Reply


Messages In This Thread
MySQL_GetFloat, is this correct? - by Dokins - 12.08.2013, 20:54
Re: MySQL_GetFloat, is this correct? - by AndreT - 12.08.2013, 21:02
Re: MySQL_GetFloat, is this correct? - by Dokins - 12.08.2013, 21:13
Re: MySQL_GetFloat, is this correct? - by Dokins - 12.08.2013, 21:23
Re: MySQL_GetFloat, is this correct? - by Kreatyve - 12.08.2013, 21:34
Re: MySQL_GetFloat, is this correct? - by Dokins - 12.08.2013, 21:39
Re: MySQL_GetFloat, is this correct? - by AndreT - 12.08.2013, 21:41
Re: MySQL_GetFloat, is this correct? - by Dokins - 12.08.2013, 21:57

Forum Jump:


Users browsing this thread: 1 Guest(s)