Random Number Generation And Probability


Posted on 16th Feb 2014 07:03 pm by admin

Hello, I am working on a function which has to insert data into a SQL table.

we have to supply the function with number of entry needs to be inserted into the database and the work of the function is to insert the entry into SQL in such a way that 30% of the entry have their type(a column in my db) as 'a' , 20% as 'b' , 40% as 'c' and rest 10% as 'd'.

Did you know?Explore Trending and Topic pages for more stories like this.
Is there any way i can do this? Do I need to run 4 while loops?

Thanks.
No comments posted yet

Your Answer:

Login to answer
347 Like 54 Dislike
Previous forums Next forums
Other forums

PHP5 - AJAX help
I've been following the tutorial on w2schools (http://www.w3schools.com/php/php_ajax_database.asp) a

Amatuer requiring assistance
Beginner and amateur in need of assistance

My Site - (Spare Parts for Domestic Appliances)

Help with ORDER BY
Hello. I would like to order by ascending States, then Cities, then Gyms in the following code, but

distinct rows
Hi
version 10.2.0.3

I have a query output something like the following

ID

problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin

Delete records not in top 15
Hi,

I'm creating a hall of fame page in my game and the page will only display the top 15 sco

How do I get the row number from from an sql table query
Hi all

I have a table that I query and it returns a number of rows.
mysql_num_rows($query)

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a

phph within href not showing php if change ? to &
Code: [Select]<a href="<?php echo $puser; ?>?m=<?php=(($m-1)&l

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash