Jump to content

retrieving values from nested post array


Lodius2000

Recommended Posts

this is a followup to my last topic, which was solved

http://www.phpfreaks.com/forums/index.php/topic,226621.0.html

 

but now the topic has changes enough to warrant a new topic

and a repost of my last post in the previous topic, which contains the question I wanted to ask here

 

so I want to split apart my post array so i can query the db

 

post looks like this

 

$_POST[1]['word']

$_POST[1]['replace']

 

$_POST[2]['word']

$_POST[2]['replace']

 

where the integer is a row number

 

so to split it apart i use

<?php
foreach ($_POST[] as $word, $replace){
      mysql_query("UPDATE badwords SET word = $word WHERE id={$_POST['id']}");
//repeat for replace
}
?>

 

is that right?

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.