Need help with Random function with Limit Variable
Posted: Thu Apr 15, 2004 12:51 pm
I have a php script that sets a variable:
And it has an include statement like this:
And in the template file I have a RAND function which currently pulls 15 entries from mysql.
Anybody know how to put the $links variable in place of the LIMIT 15? I want to be able to change the $links variable in the original php file to vary the amount of links displayed on the page. I am new to PHP and couldn't find the answer anywhere. Thanks in advance!
Code: Select all
$links=15;Code: Select all
include("template.php");Code: Select all
$sql_query = "SELECT * FROM LINKS ORDER BY RAND() LIMIT 15";