Jump to content

why does it return the word ARRAY and not what i want ?


ricky spires

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.