Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 280
0 Users 7 Guests Online
Forum Index » PHP + MySQL » news system
Posted on Thursday 6th March 2008 at 03:29 PM
atthelibrary
templates/default/images/noavatar.png's Avatar
Newbie
Hi, this is my first post :)

I'm using the news system tutorial from here for my site. It's all working fine, except for one thing. I can't get any categories to show in the drop down menu on news_admin.php, I've manually added records to the news_cats table in my database, but still nothing is shown in the dropdown selection.

Probably something stupidly simple I am missing, any help would greatly be appreciated.

Thanks, Ruth.
Posted on Thursday 6th March 2008 at 03:57 PM
DanielXP
avatars/1.png's Avatar
Senior Member
Find
PHP Code
1
$get_cats = mysql_query("SELECFT * FROM `news_cats` ORDER BY `name` ASC");


In your news_admin.php and replace with

PHP Code
1
$get_cats = mysql_query("SELECT * FROM `news_cats` ORDER BY `name` ASC");


Thats all i can see while quickly going over the code.
Posted on Thursday 6th March 2008 at 05:01 PM
atthelibrary
templates/default/images/noavatar.png's Avatar
Newbie
Thanks, I changed that, and that listed the news on the news_admin.php page, but this is still coming up with no categories in the dropdown.... Like this.. (not sure what tags are available on here)

http://img.photobucket.com/albums/v168/atthelibrary/newserror.gif

and then if i leave that blank it comes up with the same error - 'must complete all fields'

meh :(
Posted on Thursday 6th March 2008 at 05:16 PM
DanielXP
avatars/1.png's Avatar
Senior Member
Change this

PHP Code
1
2
3
print "<option value=\"$cats[id]\" selected=\"selected\">$cats[title]</option>\r\n"; //selected ^^
}else{ //or it isnt
print "<option value=\"$cats[id]\">$cats[title]</option>\r\n"; //echo regular


to

PHP Code
1
2
3
print "<option value=\"$cats[id]\" selected=\"selected\">$cats[name]</option>\r\n"; //selected ^^
}else{ //or it isnt
print "<option value=\"$cats[id]\">$cats[name]</option>\r\n"; //echo regular


I swear shadow never tests his scripts :S
Posted on Thursday 6th March 2008 at 05:28 PM
atthelibrary
templates/default/images/noavatar.png's Avatar
Newbie
haha no! Still not working, Also delete comments doesn't work & when you have to enter the image verification, an image doesn't appear. Oh well, I've given up for today, need some fresh eyes
Posted on Thursday 6th March 2008 at 05:38 PM
DanielXP
avatars/1.png's Avatar
Senior Member
Ok, im going to do myself something to eat.

I'll message shadow and tell him the url for this topic.
Posted on Thursday 6th March 2008 at 06:22 PM
ShadowMage
templates/default/images/noavatar.png's Avatar
Senior Member
@_x a few table errors and such i'll get this updated tonight when i get home as i don't have any of my stuff on me EG my compy T_T server is blocked from here at school so yeah. but for your verification image open .htaccess and add:

Code

RewriteEngine On
RewriteRulre ^ver.jpg$ img.php
Posted on Thursday 6th March 2008 at 09:06 PM
atthelibrary
templates/default/images/noavatar.png's Avatar
Newbie
thanks love, would appreciate that.

Rewriterule ;)
Posted on Friday 7th March 2008 at 06:06 PM
DanielXP
avatars/1.png's Avatar
Senior Member
Shadow put a a extra r in it "Rulre" > "Rule"
Posted on Tuesday 11th March 2008 at 06:21 PM
atthelibrary
templates/default/images/noavatar.png's Avatar
Newbie
Just wondered if there was any updates on this yet?

ta