Jump to content

[SOLVED] RAND() problem.


NArc0t1c

Recommended Posts

Hello.

 

I'm sitting here with a problem I cannot seem to pass.

What I am trying to do is select data from row, ordered by it's rank.

So, that means, the higher the rank, the more likeley it will be picked.

Here is my query sofar;

select `id`,`name`,`image`,`url`,`mid`,`status` FROM `people` where `status`='1' order by rand(`rank`) limit 1

 

I have read the mysql documentation of the rand function, but I don;t know/can't find info on this.

Is it maybe that it can only handle numbers, if so, won't it return a number in any case.

The type of `rank` is int and set to 10 characters.

 

Edit: Oh yes.., the error; #1210 - Incorrect arguments to RAND

 

I really need help on this.

Thanks

Ferdi

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.