Hey does anyone know of a cleaver way of adding a delete to each of my form entries.
I found this line to use with the form, $dbQuery = $modx->db->delete( $table_prefix . ’deleteFromTableName’, ’some_field = 1 AND name=\’’.$dbTable[name].’\’’, ’’ );
But I would like something like the standard code but:
<?php
$output = '';
$sql = $modx->db->query( 'SELECT * FROM `customers` LIMIT 0, 1000');
$resultArray = $modx->db->makeArray( $sql );
foreach($resultArray as $item)
{//start looping through the data array
$params['name']=$item['name'];
$params['date']=$item['date'];
$params['rate']=$item['rate'];
$params['net']=$item['net'];
$output.=$modx->parseChunk('customerTpl', $params, '[+', '+]');
}
return $output;
?>
Add some kind of var that has the location to each entry and add it to a delete button?