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'.

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

TimeZoneOffset
Hello,

Please i need your help. I have a system that users can use to punch in and out. This

max() problem
I have a while loop to get image names.
Code: $imagequery = mysql_query("SELECT * FROM ad_i

Add User script "Could not execute query"
This should be an easy script but I can't get it to run. Can someone please help me?

<

square instead of number
Hello
I do not know why but this code seems to work fine only in my xampp local insallation but n

Trigger tag in aspx is not coming
hi all ,iam new to ajax, iam using file upload inside the update pannel but right now i want to use

How do I use a global footer..?
If my index.php has a bole bunch of if functions and exit's in them

SAP Business Suite
Hi all:

Within the SAP Business Suite solution I would like to ask you the main differenc

check comment for html
hi, I just wanted to check if a comment a user posts contains HTML, and if it does, to not allow it

Why will this program not run if the variables are not global?
Hey guys I have a kind of perplexing situation that is probably simple, but I can't seem to understa

Career Change into SAP
Hai
I am sajesh ,did my diploma in Mechatronics i have a 4 years of experience in

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