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

insert PHP code into function
Hi,
I'm having problems when trying following:

I have:
Code: [Select]createBar("Do

how to transport the Query and insfoset
Hi

I have created the query using SQ01........
How to created T-code for query..

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

Just a white page
Okay so, my website, when I click SignUp on it it takes me to /join.php but its a complete white pag

Schedule editor
Hi,

I have a question related to Schedule editor.
If we schedule a BLS for every 30

Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to

Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment

Login Issue's
Code: <?php
$file = fopen('user.txt', 'r');

/* Set login to false initially */

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

Simple MySQL query...
Hello,
How could I do a mysql query that does this: SELECT * WHERE date/time < 5minutes ag

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