Mysql question
#1

i have a simple mysql question

i have a table with one row called Name

like this

Name

[ISS]jumbo
blabla
blabla2
LOL
omg
xD


with all names and i want to get one name in random! how i can do it ?
Reply
#2

please <.<
Reply
#3

For your MySQL query:
Код:
SELECT Name FROM table ORDER BY RAND() LIMIT 1
The query selects the name (you might want to change 'Name' to your field name for player names) and from table (you'll need to change table to the table where you keep your users) and it orders randomly and limits the query to only return 1 result.
Reply
#4

pawn Код:
format(query,sizeof(query),"SELECT NomePlayer FROM players ORDER BY Rand() LIMIT 2");
        mysql_query(query);
        mysql_store_result();
        while(mysql_fetch_row_format(Data,"|"))
        {
            sscanf(Data, "p|s", Test[0]);
            printf("Nome %s",Test[0]);
        }
        mysql_free_result();
this show me 2 names in random right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)