Thread: SQL Affiliates
View Single Post
Old 05-14-2008, 07:15 AM   · #5
netzilla
Senior Member
 
netzilla's Avatar
 
Name: Josh Evans
Location: Ohio
Trader Rating: (34)
Join Date: Aug 2005
Posts: 1,704
NP$: 149.75 (Donate)
netzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to behold
Use this on your (php) page where you want to include the links:

Code:
<?php include("filename.php"); ?>



Here is a basic php script to connect to a mysql database, query, and display the links which would you put into filename.php:

Code:
<?php # db vars $dbuser = "dbuser"; # username $dbpass = "dbpass"; # password $database = "dbname"; # name of database $dbhost = "localhost"; # usually localhost # db connect $dbh = mysql_connect($dbhost, $dbuser, $dbpass) || die ("Unable to connect to host"); $selected = mysql_select_db($database) || die ("Unable to select database"); # query $query="SELECT url from [[tablename]]"; $result=mysql_query($query); $numrows = mysql_numrows($result); $i = 0; while ($i < $numrows) { $url=mysql_result($result,$i,"url"); echo "<a href=\"$url\">$url</a><br>"; $i++; } ?>


Replace:

[[tablename]] = the table name that contains the url data


Please register or log-in into NamePros to hide ads
__________________
"If PHP is peanut butter...then...MySQL would be the jelly. Together they can make one heck of a good sandwich." --- Netzilla 9/14/08
netzilla is offline   Reply With Quote
Site Sponsors
Find out how! http://www.mobisitetrader.com/ Hunting Moon
Advertise your business at NamePros
All times are GMT -7. The time now is 02:49 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.