Dragen Posted May 8, 2007 Share Posted May 8, 2007 okay.. i'm sure this is extremely simple but.... I'm trying to print the results of an array taken from my database. here's my code: $subc = array($subcdat); print_r($subc); The problem it's outputting: Array ( [categories_name] => Spoon Boy ) when I only want it to output: Spoon Boy. I'm trying to save the spoonboy as a variable to use, so I'm using the print_r function to check what it's outputting. If it's outputting correctly I'll use $subc as the variable to read from. Hopefully that makes sense! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/50468-solved-outputting-just-the-result-of-an-array-im-sure-its-easy/ Share on other sites More sharing options...
Dragen Posted May 8, 2007 Author Share Posted May 8, 2007 nevermind, it's sorted... just needed to echo the statement like this: <?php echo $subc[categories_name]; ?> Quote Link to comment https://forums.phpfreaks.com/topic/50468-solved-outputting-just-the-result-of-an-array-im-sure-its-easy/#findComment-247978 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.