Code: Select all
<?php
if($_GET['act'] == "generate_quotes") {
$db = mysql_connect(l*", "*", "*") or die ("Unable to connect to database.");
mysql_select_db("quote") or die ("Unable to select database.");
$result = mysql_query( " SELECT * FROM `quote` ORDER BY RAND() LIMIT 0,1 " );
$fetch = mysql_fetch_array($result);
echo "<blockquote>".$fetch['q_quote']."</blockquote>";
mysql_close($db);
} else {
echo "<img src=\"1.png\">";
}
?>
<div id="gen"><a href='gengen.php?act=generate_quotes'>Generate</a></div>
Could anyone tell me a good way of going about doing this?>
http://www.wickham43.net/showform.php?n ... phpnewsbox
I found this, which uses just PHP, but sadly this uses .inc files and not a databse.
thanks for any input.