Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!empty($_POST)){
- // prepare sql and bind parameters
- //Now they are being sanitized too!
- //You really don't need to create a variable for each one unless
- //you want to use it somewhere else on the page. You could just
- //use Input::get down in the array below
- $task_id = Input::get('task_id');
- $task_utilizator = Input::get('task_utilizator');
- $task_sub_descriere = Input::get('task_sub_descriere');
- $utilizator = Input::get('utilizator');
- $titluu = Input::get('titluu');
- $data_post = Input::get('data_post');
- $descriere = Input::get('descriere');
- $status_urgent = Input::get('status_urgent');
- $status_normal = Input::get('status_normal');
- $status_anulare = Input::get('status_anulare');
- $status_gata = Input::get('status_gata');
- $time_start = Input::get('time_start');
- $time_end = Input::get('time_end');
- //Create an array of fields for your insert query
- $fields = array(
- 'task_id' => $task_id,
- 'task_utilizator' => $task_utilizator ,
- 'task_sub_descriere' => $task_sub_descriere,
- 'utilizator' => $utilizator,
- 'titluu' => $titluu,
- 'data_post' => $data_post,
- 'descriere' => $descriere,
- 'status_urgent' => $status_urgent,
- 'status_normal' => $status_normal,
- 'status_anulare' => $status_anulare,
- 'status_gata' => $status_gata,
- 'time_start' => $time_start,
- 'time_end' => $time_end
- );
- //Run the insert.
- //to do an insert query, you only need to know what table and an array of fields. This creates, prepares, binds, and sanitizes your db update.
- $db->insert('task_list_sub',$fields);
- //here is the id of the above query
- $newTaskId = $db->lastId();
- //Put your sub queries down here...
- //Then when you're done...
- Redirect::to('Location: account.php');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement