12.08.2013, 21:13
Quote:
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. |
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.