0

I m working on advertise website for that i need to select random values from the database
so please help me

Thanx in advance

3
Contributors
3
Replies
6
Views
9 Years
Discussion Span
Last Post by anupam294
0

i Got the result myself and answer is

SELECT * FROM tablename ORDER BY Rand() LIMIT 0,30

bye

-1

i Got the result myself and answer is

SELECT * FROM tablename ORDER BY Rand() LIMIT 0,30

bye

Hey thanks allot for the information... just have a small question about the 0,30 numbers in the code, those mean how many units of data will choose¿¿

0

<?php
ob_start();
include("conn.php"); //connection file
$sql = "select* from tablename order by rand()"; (rand is function of php not a field)
$query = mysql_query($sql);
$data = mysql_fetch_array($query);

?>

<?php echo $data;?> ( m is field name )

thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.