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

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

double and single quotes in text fields acting up... help please
Single quotes, when entered into a text field, create an sql error upon Submit. It seems to create t

ScriptResource.axd gives an error on fresh install of ASP.NET Ajax 1.0
Hello,I have a fresh install of Microsoft ASP.NET Ajax 1.0. When I create an Ajax enabled website in

php redirecting
i wont open a new thread but i have a question about redirecting....
i wonder why my code doesnt

Menu restriction
How can I restrict the individual menu that would appear when a user logs in so that all users are c

MySQL noob question
hi guys

I have a simple mysql table set up, along the lines of

Col 1 - Col 2 - Date_l

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

help with email script...
hey

I need help with my mail script

when the form on http://www.mcgdesignstudio.com/c

Inserting the current date/time while submitting the forum
What do I need to add below to update the current date/time? I have a field in the database called d

textfield unchanged
hi,
i want my form to know whether its textbox is unchange or not.

if($textbox == 'unchang

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