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.

347 Like 54 Dislike
Previous php-forum Next php-forum
Other php-forum

Could Someone Please Debug This?
I was wondering if someone could debug this script for me. I realize it's not the tidest script (and

SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically a

Session problem?!?
Hello All! I am very new to the php world but I am working on fixing things that a previous programm

TimeZoneOffset
Hello,

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

PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.

Thanks!

Help pulling in 'id' with "read more" link
I'm trying to create snippets of my articles in the cms I'm creating, and then have them redirect to

Warning: Cannot modify header information - headers already sent by (output sta
Warning: Cannot modify header information - headers already sent by (output started at /home/praylif

foreach and array need help combining
Hi guys.

Here's the code

Code: array(
'tag' => 'code',<

phpMailer will not connect using SMTP
I am trying to use phpMailer with smtp:

Code: [Select]$mailer = new PHPMailer();
$mailer-&

Word filter problem
Hello,

im trying to make a filter for words inputted in to my website but i want to store the

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