$feed = array ( 'psp' => '7', 'ps3' => '9', 'xbox360' => '17', 'wii' => '14', 'nds' => '12', 'reviews' => '21', 'main' => '2,3,7,9,12,14,17' ); if (isset($section)) { $forumid = $feed[$section]; } else { $forumid = $feed['main']; } Code (markup): The $forumid is then passed onto a mysql query. Problem is, its only listening to the else statement. Its ignoring all other values in the array, say for example if section=psp is passed in the URL it will still output the main feed. I think the problem is the if statement, but not sure whats wrong. If I manually pass the $section var it works fine, so can't be the array or query.
ah, thanks - I noticed it wasn't echoing anything so I added $section = $_GET['section']; Code (markup): and now it works Cheers
That's the beauty of dead simple debugging. ECHO the lot and see whether it is what you expected. Work your way up from there.
I agree with you very much on this one TopS30 When I am debugging a script I start inserting echos and print_r's all the way along the script and see what the output is at the end. Very good and very useful then more advanced debugging techniques imo.