Irish SEO,  Marketing & Webmaster Discussion

 

Tiny problem

This is a discussion on Tiny problem within the Coding Help forums, part of the Webmaster Help category; Hi everyone.. Ok I have a db set up that two tables in it One called nt_posts the other nt_category ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 31-01-2008, 02:55 PM
Joseph Grogan's Avatar
Wannabe Geek
 
Join Date: Jul 2007
Location: Bogland, beside birr...Cloghan
Posts: 147
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Joseph Grogan will become famous soon enough
Send a message via Skype™ to Joseph Grogan
Default Tiny problem

Hi everyone.. Ok I have a db set up that two tables in it

One called nt_posts the other nt_category

Inside nt_posts i have
  • post_id
  • post_name
  • post_content
  • category_id
and in nt_category i have
  • category_id
  • category_name
Now i have a form set up and I can select a category name to input into the category_id of the nt_posts table and it works fine as i checked it in phpmyadmin and it enters the info properly.

Now here is the problem. I have a page that outputs all the posts and on the side are category links. So when I click on a category it will only display ones with that category_id. It works when the category_id=1 but not for any other bnumber.

Here is the php code i am using to select results from seperate tables as i want to be able to say what category they selected

PHP Code:
$query "SELECT * FROM nt_post, nt_category WHERE nt_post.category_id=$category_id = nt_category.category_id=$category_id"
It works fine if i only have it selecting from one table (the nt_posts table) but then i can display the name of the category.

Any one have any ideas
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 31-01-2008, 03:04 PM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 2,022
Nominated 2 Times in 1 Post
Nominated TOTW/F/M Award(s): 1
Forbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enough
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

quick look .. didn't read your post fully but ... this should work I think

Code:
$query = "
  SELECT
    *
  FROM 
    nt_post, 
    nt_category 
  WHERE 
    nt_post.category_id=$category_id AND
    nt_category.category_id = nt_post.category_id
";
__________________
Forbairt Media | Web Design & Development Galway / Dublin, Ireland - coming soon ... ( vague but descriptive isn't it )
Recent Work: Safari Club African Safari Holidays - South Africa Safaris
Other Stuff: FluffyLinkulator Rapid Inclusion Service Tools
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 31-01-2008, 03:07 PM
Joseph Grogan's Avatar
Wannabe Geek
 
Join Date: Jul 2007
Location: Bogland, beside birr...Cloghan
Posts: 147
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Joseph Grogan will become famous soon enough
Send a message via Skype™ to Joseph Grogan
Default

That worked perfectly... Cheers James. You dont know how long i was looking at the and didnt even notice that
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 31-01-2008, 03:09 PM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 2,022
Nominated 2 Times in 1 Post
Nominated TOTW/F/M Award(s): 1
Forbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enough
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

no problem ... I'm having a day of too many work emails and calls ... its doing my head in I want to get back to some coding
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 31-01-2008, 03:12 PM
Joseph Grogan's Avatar
Wannabe Geek
 
Join Date: Jul 2007
Location: Bogland, beside birr...Cloghan
Posts: 147
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Joseph Grogan will become famous soon enough
Send a message via Skype™ to Joseph Grogan
Default

Its sort of good to have days like that cause it means you are getting work. Which is the main thing... is it not
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 31-01-2008, 03:16 PM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 2,022
Nominated 2 Times in 1 Post
Nominated TOTW/F/M Award(s): 1
Forbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enoughForbairt will become famous soon enough
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

thats one way of looking at it ...

Actually a good bit of support and proposals (I like to think they are decent ... thought the clients may disagree )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
problem, tiny

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Javascript No properties defined problem? Ciarán Mc Cann Coding Help 2 03-01-2008 05:29 PM
mySQL BLOB Problem ziycon Coding Help 3 17-11-2007 06:41 PM
PHP mySQL Problem!? ziycon Server / Technical Administration Tips and Queries 1 15-07-2007 08:31 PM
Making the second post in vbulletin topic an advert. Problem! dude Coding Help 3 04-04-2007 12:33 PM
Blog XML feed duble quotes problem Redfly Forum Feedback, Development and Competitions 3 30-11-2006 10:56 PM


All times are GMT +1. The time now is 06:23 AM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0