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

The type or namespace name 'ServiceModel' does not exist in the namespace 'System'
When I locally run the website, it works just fine, but when I uploaded it to the hosting environmen

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

Search function
I am looking for some guidance from the experts.

I am trying to create a search function. It

ASP.NET Validation Event Cycle
Hi,
I have asp button as follow:

Auto-populating dropdowns and multiple forms.
Here's what I have so far:

First drop down = select a state (works)
This populates the sec

Thread in PHP
Thread in PHP
Some basic use and basic code for thread in php
This is my question?

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

CURL question
i am wondering if it's possible to use multi curl with login something like

login once to web

str_replace help
Hey there,

I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean

understanding functions and classes
Code: [Select]
class person {
var $name = "Jimmy Goe";

function get_nam

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