Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

PHP OOP Doubt

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

PHP OOP Doubt

Postby Harok » Mon Oct 01, 2012 10:23 am

Hello guys :D

I want to do the following:

Code: Select all
foreach ($_POST['mce_member'] as $member) {
    $this->mce->setMceMember($member);
    $result = $this->mce->insertMce();
    echo $this->mce->getMceMember().'<br/>';
}


This echo it`s to look the result (only to know that is all correct), but when i look the results, the insertMce() function aways is called only 1 time.

P.S.: this is to insert a lot of members dynamically.

Example:

Inserting with an input:
- a
- b
- c
- d
- e

Echo returns:
- a
- b
- c
- d
- e

function insertMce() insert on database:
- a


I don't know if i was clear enough.
Can anyone help me pls??
Harok
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon Oct 01, 2012 10:13 am

Return to PHP coding => General

Who is online

Users browsing this forum: robertrfp and 4 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.