[eluser]SaSa[/eluser]
hello
i want delete row on mysql but is a problem, i can not get input checkbox on viwe page by $this->input->post.
whay?
my CI_Controller:
Code:
$id = $this->input->post('checkbox');
$checkbox = $this->db->where('code', $id);
$this->db->delete('customer');
$date ['date'] = print_r($checkbox);
$this->load->view('admin/customer_size_show', $date);
my viwe page:
Code:
$query = $this->db->get('customer');
foreach ($query->result() as $row)
{
echo '<table id="tableeven" border="0" cellpadding="0" cellspacing="0">';
echo '<tr><td><input name="checkbox" type="checkbox" value="'.$row->code.'"></td>';
echo '<td class="tableshow_in">'.$row->name.'</td>';
echo '<td class="tableshow_in">' .$row->mail. '</td>';
echo '<td class="tableshow_in">' .$row->tel. '</td>';
echo '<td class="tableshow_in">' .$row->date_added. '</td>';
echo '<td class="tableshow_in">' .$row->order. '</td>';
echo '<td class="tableshow_in">' .$row->code. '</td></tr>';
echo '</table>';
}
print_r:
Quote:CI_DB_mysql_driver Object ( [dbdriver] => mysql [_escape_char] => ` [_like_escape_str] => [_like_escape_chr] => [delete_hack] => 1 [_count_string] => SELECT COUNT(*) AS [_random_keyword] => RAND() [ar_select] => Array ( ) [ar_distinct] => [ar_from] => Array ( ) [ar_join] => Array ( ) [ar_where] => Array ( ) [ar_like] => Array ( ) [ar_groupby] => Array ( ) [ar_having] => Array ( ) [ar_keys] => Array ( ) [ar_limit] => [ar_offset] => [ar_order] => [ar_orderby] => Array ( ) [ar_set] => Array ( ) [ar_wherein] => Array ( ) [ar_aliased_tables] => Array ( ) [ar_store_array] => Array ( ) [ar_caching] => [ar_cache_exists] => Array ( ) [ar_cache_select] => Array ( ) [ar_cache_from] => Array ( ) [ar_cache_join] => Array ( ) [ar_cache_where] => Array ( ) [ar_cache_like] => Array ( ) [ar_cache_groupby] => Array ( ) [ar_cache_having] => Array ( ) [ar_cache_orderby] => Array ( ) [ar_cache_set] => Array ( ) [username] => root [password] => [hostname] => localhost [database] => diba [dbprefix] => [char_set] => utf8 [dbcollat] => utf8_general_ci [autoinit] => 1 [swap_pre] => [port] => [pconnect] => 1 [conn_id] => Resource id #32 [result_id] => 1 [db_debug] => 1 [benchmark] => 0.0010581016540527 [query_count] => 2 [bind_marker] => ? [save_queries] => 1 [queries] => Array ( [0] => SELECT * FROM (`ci_sessions`) WHERE `session_id` = 'e5119722e251b1fc23e5eeec0ed2b93f' AND `user_agent` = 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (K' [1] => DELETE FROM `customer` WHERE `code` = 0 ) [query_times] => Array ( [0] => 0.00049614906311035 [1] => 0.00056195259094238 ) [data_cache] => Array ( ) [trans_enabled] => 1 [trans_strict] => 1 [_trans_depth] => 0 [_trans_status] => 1 [cache_on] => [cachedir] => [cache_autodel] => [CACHE] => [_protect_identifiers] => 1 [_reserved_identifiers] => Array ( [0] => * ) [stmt_id] => [curs_id] => [limit_used] => [stricton] => )
Code:
... DELETE FROM `customer` WHERE `code` = 0 ...