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

Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "

ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because th

Gantt Chart Tool
Does anyone know of a good free gantt chart creator tool

Thanks

PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in.
Moderator

extending tidy
I have problem with type-hinting and extending tidy. This code creates error:
Code: class cMyTidy

Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data d

Intrastat Report Config in ECC 6.0 - goods Movement in EU countries
Colleagues, need ur help to understand the changes require in ECC 6 standard Report configuration se

parse error
Parse error: syntax error, unexpected '[', expecting ')' in /Users/admin/Sites/phptest/array.php on

PHP Search Issue
Hi, I am using the following code to search and return flights from a database. The user searches by

Text to picture Generator
Hello, i have found this script and it works really good^^ But i have one problem, i would like to c

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