Login

Member statsTotal: 206Latest: CcardinGuests online: 5Members online: 0
EmailLogin here

Location
ForumHelp & Support • Cannot add categories code to a certain page

Access: Member
Total posts: 2

Status: Offline
Cannot add categories code to a certain page Quote 

Hey,

I have been trying to get categories on a certain page, just like this one.

I own this site, and my mate Tyler Helton created it. I havent been able to get hold of him so i dont know what to do.

I copied the code from it:
Code:
<?php
include 'n-13news/db.php';
include 'n-13news/config.php';
$sql = "SELECT * FROM $newscats";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
echo "<a href=\"?cat=$row[name]\">$row[name]</a><br>";
}
if($_GET['cat']){
echo "<br><br>";
$cat = $_GET['cat'];
include 'n-13news/index.php';
}
if($_GET['id']){
echo "<br><br>";
include 'n-13news/index.php';
}
?>

and put it in my page,

I then created a category in the n-13news control panel, and then made a news post in that category.

It turned out like this.

When i click on the link 'School' it brings up with this:
Code:
Fatal error: Cannot redeclare uniqueid2() (previously declared in /home/bass2k8/public_html/n-13news/config.php:34) in /home/bass2k8/public_html/n-13news/config.php on line 38

I checked that file, and found that line 34 had the contents of:
Code:
$id = md5(uniqid(rand(), true));

and line 38 had the contents of:
Code:
}

I do not know what is wrong with it but i would like to get it working =D

Hope u can help me Chris!
04:02pm 22nd Sep 08  
Last edited by Bass2k8 at 04:02pm 22nd Sep 08
Access: Admin
Total posts: 174

Status: Offline
Cannot add categories code to a certain page Quote 

in 'news/index.php'

at the top of it try removing the 2 lines that include db.php and config.php

because you've already included these files manually yourself they don't need to be included there.
11:58am 23rd Sep 08
_______________
Chris - Network-13
Access: Member
Total posts: 2

Status: Offline
Cannot add categories code to a certain page Quote 

i did that, and now it comes up with:
Code:
Warning: mysql_query() [function.mysql-query]: Access denied for user 'bass2k8'@'localhost' (using password: NO) in /home/bass2k8/public_html/test.php on line 22

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/bass2k8/public_html/test.php on line 22

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/bass2k8/public_html/test.php on line 23

03:09pm 23rd Sep 08  
Post a reply!