freelanceprogrammers.org Forum Index » PHP

problem with array posting method(form)


View user's profile Post To page top
k_madhana_gopal Posted: Mon Aug 29, 2005 4:49 pm


Joined: 29 Aug 2005

Posts: 2
problem with array posting method(form)
member:: Array
(
[0] => Array
(
[0] => 27
[id] => 27
[1] => 27
[state] => 27
[2] => active
[status] => active
[3] => Eugene
[city] => Eugene
[4] => EUG
[airport] => EUG
[5] => dp
[service] => dp
)
)


These isthe array structure of the fetched fields from the database.WHen i loop
for the member variable




foreach($member as $key=>$val)

{

?>

<!-- <td width="">City Name:</td> <td>Airportname</td>

<td>Statename</td><td>Status</td><td>Service</td>

</tr>-->



<tr>

<td><input type=checkbox name=id[] value="<?=$Form->getfields($key,`id`)?>"
selected=true></td>

<input type=hidden name=hid_id[] value="<?=$Form->getfields($key,`id`)?>">

<td><input type="text" name="city[]"
value="<?=$Form->getFields($key,`city`)?>"></td>



<td><input type="text" name="airport[]"
value="<?=$Form->getFields($key,`airport`)?>"></td>



<td>
}

it will produce three rows.NO problem with this so far.But my problem is when i
edit those rows and select the rows with the help of check box



City Name:AirportnameStatenameStatusServiceCity Name: Airportname
StatenameStatusService --> [input] [input] [input] NY PA Nj MD ME MA VT
VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR AK HI PR aaaa rem
[input] -->like this
--> Dash Priority Dash/Priority Active Deactivate [input] [input] [input]
NY PA Nj MD ME MA VT VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR
AK HI PR aaaa rem [input] -->

--> Dash Priority Dash/Priority Active Deactivate [input] [input] [input]
NY PA Nj MD ME MA VT VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR
AK HI PR aaaa rem

the array gets converted like this.





member:: Array
(
[id] => Array
(
[0] => 27
)

[hid_id] => Array
(
[0] => 27
)

[city] => Array
(
[0] => Eugene
)

[airport] => Array
(
[0] => EUG
)

[service] => Array
(
[0] => dp
)

[status] => Array
(
[0] => active
)

[Update] => save changes
)






Because of this when i submit it checks seven arrays and produces similar
structure shown below.

City Name:AirportnameStatenameStatusServiceCity Name: Airportname
StatenameStatusService --> [input] [input] [input] NY PA Nj MD ME MA VT
VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR AK HI PR aaaa rem21
[input] -->
--> Dash Priority Dash/Priority Active Deactivate [input] [input] [input]
NY PA Nj MD ME MA VT VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR
AK HI PR aaaa rem [input] -->

--> Dash Priority Dash/Priority Active Deactivate [input] [input] [input]
NY PA Nj MD ME MA VT VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR
AK HI PR aaaa rem [input] -->
-->
Dash Priority Dash/Priority Active Deactivate [input] [input] [input] NY PA
Nj MD ME MA VT VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR AK HI
PR aaaa rem [input] -->
--> Dash Priority Dash/Priority Active Deactivate [input] [input] [input]
NY PA Nj MD ME MA VT VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR
AK HI PR aaaa rem [input] -->

--> Dash Priority Dash/Priority Active Deactivate [input] [input] [input]
NY PA Nj MD ME MA VT VA OH NM LA TX WI CO IA MI GA NC AL SC TN FL MT ID CA NV OR
AK HI PR aaaa rem [input] -->

--> Dash Priority Dash/Priority Active Deactivate [input] Warning: Missing
argument 2 for EditCityAirportsForm::getFields() in
D:apachefriendsxampphtdocsmadhanshipcalcincludesclassesAdminFormClasses.
lib.php on line 619
">--> [input] Warning: Missing argument 2 for EditCityAirportsForm::getFields()
in
D:apachefriendsxampphtdocsmadhanshipcalcincludesclassesAdminFormClasses.
lib.php on line 619
">--> --> [input] [input]



Now how can i restructur my array so that only three rows are displayed with
updated values.

Get me some example codes if posible.........Desparately needed...





Madhanagopal.k

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

[Non-text portions of this message have been removed]
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help