right i will assume that you have phpmyadmin or something similar on your server and you know how to add tables etc to a mysql database
first create a table in your database - call it anything you want though something descriptive would be best
we'll call the table featured_link
this table will have 4 fields
id - integer
link_name - varchar or text
link_url - varchar or text
link_details - text
next create a php file called dbconnect.php
Quote:
<?php
mysql_connect(localhost, database_login, database_pass);
mysql_select_db("database_name");
?>
|
you will have to edit this short file to suit your database
database_login is the login name to access your database
database_pass is the password to login with
database_name is the name of the database
next we need to create a short script that you can include in any of your pages though the page will have to use a .php extension - not sure if you wanted this or not
Quote:
<?php
include "dbconnect.php";
$query = mysql_query(" SELECT * FROM `featured_link` ORDER BY RAND()");
$result = mysql_fetch_array($query);
$name=$result['link_name'];
$url=$result['link_url'];
$details=$result['link_details'];
echo "<b>Featured Link</b><br>";
echo "<a href=\"$url\"><b><font color=\"#ff0000\">$name</font></b></a> - $details";
mysql_close();
?>
|
edit the above code to suit your needs
this is a very simple script and i know it uses php extensions which im not sure you want but it does work
hope this helped 
|