URGENT

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
sowmya_ganesh
Forum Newbie
Posts: 8
Joined: Tue Nov 18, 2003 11:51 pm
Location: India

URGENT

Post by sowmya_ganesh »

Please help me

i got data from mysql like below

$rsSize= mysql_query ($sSql);
while($rsSizeRow = mysql_fetch_array($rsSize))

this will give all roww one by one

but i want to get a perticualr row in array ?

say i want to take a row by using rand ?

how it is possible ?

psl help me
User avatar
aquila125
Forum Commoner
Posts: 96
Joined: Tue Dec 09, 2003 10:39 am
Location: Belgium

Post by aquila125 »

If you just want a random row from the database use this:

SELECT ..... FROM table_name WHERE ... ORDER BY rand() LIMIT 0,1

it will give you 1 row, selected randomly
Post Reply