Rand() help needed


Posted on 16th Feb 2014 07:03 pm by admin

Hi all,

Can someone explain and give me a quick example of how I would go about this?

I have 100 values in a database with colum headings of t_val and t_name. If I wanted to update all 100 of these with a rand number how would I do this?

Would I do something like this?
Code: [Select]t_val1 = rand(1,10);

What I want to do is have different variances in the rand as well. So ten would be rand(1,10) and the next ten would be rand(5,20) for example?

Many Thanks

No comments posted yet

Your Answer:

Login to answer
150 Like 44 Dislike
Previous forums Next forums
Other forums

Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?

Disable Scrollbar in TableControl
Hello everbody,

please can anybody help me - outherwise i'm going to become desperate :P<

session_destroy();
new to php
I have a simple login and am trying to write a logout.
I set a $_SESSION var to 1 i

Phase Error I can't seem to find :(`
Hey guys, I can seem to find my phase error on this. I am getting this error

[error]
Pars

PHP Mysql Staff Induction System
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi

mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div

update the selected existing records of database
Hi frndz,
I am new to php and get stuck....

Edit.php > Update.php > Updatea

jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are

split string
Hi all

i have some names (imploded by comma):
Code: toronto,paris,madrid
Now, i would

Locking mysql tables with php
Hi

BACKGROUND:
I have multiple instances of the same php script running in a WAMP environ

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