Virajsinh

quick_suggest_php

Sep 4th, 2019
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.82 KB | None | 0 0
  1. Back-end Suggestion in PhP
  2. --------------------------------------
  3. <form action="file_name.php" method="post" enctype="multipart/form-data">
  4. </form>
  5. Note : "enctype" use for file upload control.
  6. --------------------------------------
  7. perfect view for array
  8. --------------------------------------
  9. echo "<pre>";
  10. print_r($_REQUEST);
  11. echo "</pre>";
  12. --------------------------------------
  13. DataTable
  14. --------------------------------------
  15. https://webdamn.com/datatables-add-edit-delete-with-ajax-php-mysql/
  16.  
  17. --------------------------------------
  18. SELECT (SELECT GROUP_CONCAT(" ",name) FROM tbl_course WHERE FIND_IN_SET(id,study_id)) FROM tbl_users
  19.  
  20. Sub-Query in MySql Without Joins
  21. SELECT name, description, status, (SELECT username from tbl_users where id=created_by) FROM tbl_projects
  22. --------------------------------------
  23. $result = mysqli_query($conn, $query);
  24. foreach($result as $row)
  25. {
  26.     echo $row['first_name'];
  27. }
  28.  
  29. "UPDATE tbl_tasks_times SET end_time = '$stop_time', total_time =(SELECT TIMEDIFF('$stop_time',start_time)) WHERE task_id = '$id'";
  30.  
  31. SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(TIME_FORMAT(total_time,'%H:%i:%s')))) FROM tbl_tasks_times WHERE task_id = $id;
  32.  
  33.     $task_calc = "SELECT total_time FROM tbl_tasks WHERE id = $id";
  34.     $task_result = mysqli_query($conn, $task_calc);
  35.     $task_time = mysqli_fetch_array($task_result, MYSQLI_BOTH);
  36.     echo $task_time['total_time'];
  37.  
  38.         $data = array(
  39.             'task_id'=>$task_id,
  40.             'start_time'=>$task_id,
  41.             'end_time'=>$task_id,
  42.             'total_time'=>$task_id
  43.         );
  44.  
  45.         $this->db->insert('tbl_tasks_times',$data);
  46.  
  47.  
  48.         $data = array(
  49.             'task_id'=>$task_id,
  50.             'start_time'=>$task_id,
  51.             'end_time'=>$task_id,
  52.             'total_time'=>$task_id
  53.         );
  54.  
  55.         $this->db->where('task_id', $task_id);
  56.         $this->db->update('tbl_tasks_times',$data);
  57. //Table Row 10 Recrod in One Row
  58. if($i % 10==0)
  59. {
  60.     echo '</tr><tr>';
  61. }
Add Comment
Please, Sign In to add comment