<?php
// Mysql Database Config
$db_host = 'localhost';
$db_db = 'Quotes';
$db_user = 'root';
$db_pass = 'root';
// Mysql Connection
$db_link = mysql_connect($db_host, $db_user, $db_pass)
or die('MySQL Connection Error:'.mysql_error());
mysql_select_db($db_db)
or die('MySQL Error: Cannot select table');
$sql = "SELECT * FROM FrontQuote WHERE FrontID = ROUND(".lcg_value()." * (SELECT COUNT(*) FROM FrontQuote)) LIMIT 1";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);
$FrontQuote=mysql_result($result,$i,"FrontQuote");
$FrontAuthor=mysql_result($result,$i,"FrontAuthor");
?>
|