Jump to content

silversand

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

silversand's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Woohooo! That was it! I didn't have the length/values set correctly. Thank you! Thank you! Can I press my luck for my other question? How to get a random decimal between two numbers with a chance of a slightly higher result? So the result from a number between 2.2 and 7.1 would be something like 5.4, but could possibly be 7.2?
  2. Wait! Just did it again and there IS a decimal there when I echo it. This is what came up. INSERT INTO owned VALUES ('', '', '','','0','0','0','0','0','0','0', '2131', '','','ftrade','no','','6.5' ) Still doesn't work when I try to use it in the code and display it from the database.
  3. Yes. It just doesn't seem to want to store as a decimal in the database
  4. Hmm, I changed the mysql to decimal but I still end up with a whole number being inserted...
  5. Aaaaah, I think they may be it. The mysql field is set to int. I'm off to go fix that now and will report back. Thanks!
  6. $headgenes = mt_rand(0, 100)/10; mysql_query("INSERT INTO ".$prefix."owned VALUES ('', '$d[$i]', '$name[$i]','$loggedinname','0','0','0','0','0','0','0', '$code', '','$alts','ftrade','no','$gend','$headgenes')");
  7. No, the number is generated and inserted into the database first and then displayed on the page when called. Even when I check the database the number is still whole or 0.
  8. I've tried that and I get a whole number or a 0. This is the solution I found while googling but for some reason it never works for me.
  9. I'm hoping someone can show me how to get a random decimal number. I've googled and can't find anything that works. I need to find a random number between 1.0 and 10.0 I can get a random whole number no problem, but decimals aren't working. When I finally get that working, ideally I'd like to be able to find a random number between two decimals (like above) but also have a small chance of getting a decimal slightly higher than the two given. So, for example, maybe a random decimal between 3.5 and 6.0, but a slight chance of getting 6.2? Thank you very much for any help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.