[advanced search]
11 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 05-14-2008, 05:57 AM   · #1
Danaldinho
New Member
 
Trader Rating: (0)
Join Date: Mar 2008
Posts: 24
NP$: 0.00 (Donate)
Danaldinho is an unknown quantity at this point
SQL Affiliates

I have created a couple of fansites now on my favourite music artists and I do the menu on the left hand side of the page. You can see the menu on one of them here: http://www.chamillionairechat.com

Anyway I am getting more and more people who want to affiliate with me and it takes me a long, long time to add their link into the box as there is hundreds of pages like all the lyrics page.

Anyway I was just wondering is it possible for me to do this a quicker way by using SQL

I haven't really used it before except for some phpbb mods

Thanks, Daniel Mousdell


Please register or log-in into NamePros to hide ads
Danaldinho is offline   Reply With Quote
Old 05-14-2008, 06:38 AM   · #2
-Nick-
I'll do it
 
-Nick-'s Avatar
 
Name: Keral. Patel.
Location: India
Trader Rating: (97)
Join Date: Dec 2005
Posts: 5,163
NP$: 9642.05 (Donate)
-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute
Member of the Month
September 2007 Adoption
You can also use PHP Include function and include one other php file with ads code in all the rest of the pages.
-Nick- is offline   Reply With Quote
Old 05-14-2008, 06:47 AM   · #3
Danaldinho
New Member
 
Trader Rating: (0)
Join Date: Mar 2008
Posts: 24
NP$: 0.00 (Donate)
Danaldinho is an unknown quantity at this point
Originally Posted by -Nick-
You can also use PHP Include function and include one other php file with ads code in all the rest of the pages.



Like an iframe?
Danaldinho is offline   Reply With Quote
Old 05-14-2008, 06:51 AM   · #4
-Nick-
I'll do it
 
-Nick-'s Avatar
 
Name: Keral. Patel.
Location: India
Trader Rating: (97)
Join Date: Dec 2005
Posts: 5,163
NP$: 9642.05 (Donate)
-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute
Member of the Month
September 2007 Adoption
Nope it is not Iframe it is pure single page HTML output without an Iframe.

Search for PHP Include Function in google.

You will know exactly what to do

Thanks.
-Nick- is offline   Reply With Quote
Old 05-14-2008, 07:15 AM   · #5
netzilla
Senior Member
 
netzilla's Avatar
 
Name: Josh Evans
Location: Ohio
Trader Rating: (28)
Join Date: Aug 2005
Posts: 1,545
NP$: 56.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 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
netzilla is offline   Reply With Quote
Old 05-14-2008, 09:03 AM   · #6
Danaldinho
New Member
 
Trader Rating: (0)
Join Date: Mar 2008
Posts: 24
NP$: 0.00 (Donate)
Danaldinho is an unknown quantity at this point
I have added my menu code into a file called: http://www.lilwaynehq.com/mainmenu.php and on my index.html file i have included: this code instead of the menu code i was using:

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


But now on my website: http://www.lilwaynehq.com/ it doesn't show anything

Anyone know what is wrong

I will also following this tutorial: http://www.w3schools.com/PHP/php_includes.asp

Thanks
Danaldinho is offline   Reply With Quote
Old 05-14-2008, 09:38 AM   · #7
netzilla
Senior Member
 
netzilla's Avatar
 
Name: Josh Evans
Location: Ohio
Trader Rating: (28)
Join Date: Aug 2005
Posts: 1,545
NP$: 56.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 behold
In order for the php code to be interpreted properly in most cases it must have a .php file extension. If you used the include() code above on your index.html...it will not work.
netzilla is offline   Reply With Quote
Old 05-14-2008, 10:47 AM   · #8
Danaldinho
New Member
 
Trader Rating: (0)
Join Date: Mar 2008
Posts: 24
NP$: 0.00 (Donate)
Danaldinho is an unknown quantity at this point
Thanks mate, that worked brilliantly

Thanks again for your help
Danaldinho is offline   Reply With Quote
Old 05-14-2008, 10:51 AM   · #9
netzilla
Senior Member
 
netzilla's Avatar
 
Name: Josh Evans
Location: Ohio
Trader Rating: (28)
Join Date: Aug 2005
Posts: 1,545
NP$: 56.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 behold
Not a problem. Glad to be a help!
netzilla is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
http://www.mobisitetrader.com/ Custom Logo Design Custom Logo Design
Advertise your business at NamePros
All times are GMT -7. The time now is 11:57 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0