ricky spires Posted December 4, 2011 Share Posted December 4, 2011 hello. im trying to get some results from a db and all i keep getting is the word ARRAY ?? I want to get all the placeholders that relate to a page. so if pageID=1 has place holder 1, place holder 2 and place holder 3 it will return 1, 2, 3 etc... in the db i have id pageID phNumber 1 1 1 2 1 2 3 1 3 etc.. this is the code i have public function find_placeholders($pageID=0){ $sql = "SELECT phNumber FROM ".self::$table_name." WHERE pages_id=".$pageID.""; $result_array = self::find_by_sql($sql); return $result_array; } and on the page i have.. <?php echo Placeholders::find_placeholders($pageID); ?> all i get is Array once i solve this problem i will want to use each number in the array to find the content for each. so if i get 1,2,3 i will try and do some thing like. foreach placeholder number echo elements but 1 step at a time thanks for any help rick Quote Link to comment https://forums.phpfreaks.com/topic/252470-why-does-it-return-the-word-array-and-not-what-i-want/ Share on other sites More sharing options...
btellez Posted December 4, 2011 Share Posted December 4, 2011 ...because you are trying to echo an array. To get something more meaningful, try print_r or var_dump <?php print_r(Placeholders::find_placeholders($pageID)); ?> OR <?php var_dump(Placeholders::find_placeholders($pageID));> Quote Link to comment https://forums.phpfreaks.com/topic/252470-why-does-it-return-the-word-array-and-not-what-i-want/#findComment-1294438 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.