coolblu
April 24th, 2002, 04:12
I am currently trying to adapt DT:Links for my own personal use.
So far I have
connect.inc
<?
$database = "localhost";
$dbname = "name_of_db";
$dbuser = "username";
$dbpass = "password";
mysql_connect($database, $dbuser, $dbpass) or die ("Couldn't connect to database.");
mysql_select_db($dbname) or die ("Couldn't select databse");
?>
admin.php
see http://ascene.l33t.ca/admin_php.txt (right click on page and go view source :))
and view.php (to view my first 10 affiliates
<?php
include('connect.inc');
$link_limit = "9";
?>
<?php
$query = "SELECT * FROM affiliates ORDER BY affilid DESC LIMIT $link_limit";
$result = mysql_query($query) or die( mysql_error() );
while ($rows = mysql_fetch_row($result))
{
echo ("<a href=\"$rows[2]\"><font face=\"arial, verdana, helvetica, sans serif\">$rows[1]</font></a>");
echo ("<br>");
echo ("<font size'1' face='arial'>$rows[4]</font>");
echo ("<br>");
}
?>
I cant seem to add affiliates to the database. The script also has its own installer (http://ascene.l33t.ca/install_php.txt) (right click on page and go view source :))
What is going wrong here?
Thanks
Coolblu
sorry for the outside links - the post was too long :)
So far I have
connect.inc
<?
$database = "localhost";
$dbname = "name_of_db";
$dbuser = "username";
$dbpass = "password";
mysql_connect($database, $dbuser, $dbpass) or die ("Couldn't connect to database.");
mysql_select_db($dbname) or die ("Couldn't select databse");
?>
admin.php
see http://ascene.l33t.ca/admin_php.txt (right click on page and go view source :))
and view.php (to view my first 10 affiliates
<?php
include('connect.inc');
$link_limit = "9";
?>
<?php
$query = "SELECT * FROM affiliates ORDER BY affilid DESC LIMIT $link_limit";
$result = mysql_query($query) or die( mysql_error() );
while ($rows = mysql_fetch_row($result))
{
echo ("<a href=\"$rows[2]\"><font face=\"arial, verdana, helvetica, sans serif\">$rows[1]</font></a>");
echo ("<br>");
echo ("<font size'1' face='arial'>$rows[4]</font>");
echo ("<br>");
}
?>
I cant seem to add affiliates to the database. The script also has its own installer (http://ascene.l33t.ca/install_php.txt) (right click on page and go view source :))
What is going wrong here?
Thanks
Coolblu
sorry for the outside links - the post was too long :)