PDA

View Full Version : I don't know how to access array values with $vbulletin->GPC[]


Oreamnos
12-11-2005, 08:42 AM
I am doing a multiple row update so my html looks like:<input type="text" name="$image[ws_id]ws_order" value="$image[ws_order]">


and then:$vbulletin->input->clean_array_gpc('r', array(
'ws_order' => TYPE_ARRAY,
));

// we also need to update the information
$update_rows = $db->query_read("
SELECT * FROM table
WHERE id = '" . $db->escape_string($info['id']) . "'
ORDER BY ws_order ASC
");

// update list
while ($do_update = $db->fetch_array($update_rows)) {

$order = $_POST[$do_update['ws_id']."ws_order"];
$update_title_directions = $db->query_write("
UPDATE table
SET ws_order = " . $db->escape_string($order) . "
WHERE ws_id = " . $db->escape_string($do_update['ws_id']) . "
");

}

as is, this works fine but i'd like to replace the $_POST[] with $vbulletin->GPC[] but when i try it's empty and creates an error.

my guess is that its not being read in the clean_array_gpc function, though im not sure. if that is the problem, is it possible to tag something like 'ws_order[]' => TYPE_ARRAY, into the function?

if not, what can i do?

eric