Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Cannot add categories code to a certain page
Bass2k8
Posted on 22 Sep 2008, 21:02:10

Access: Member
Total Posts: 2
Joined: 2008-09-22

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!
#426
Last edited by Bass2k8 at 2008-09-22 21:02:43 Reason:
Chris
Posted on 23 Sep 2008, 16:58:18

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

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.
#429
Bass2k8
Posted on 23 Sep 2008, 20:09:30

Access: Member
Total Posts: 2
Joined: 2008-09-22

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

#431
Network-13.com © 2013