Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. $user_id = get_current_user_id();
  2. $prescription_name = $_POST['prescription_name'];
  3. $date_created = date('Y-m-d');
  4. $last_updated = date('Y-m-d');
  5. $right_eye_sphere = $_POST['right_eye_sphere'];
  6. $left_eye_sphere = $_POST['left_eye_sphere'];
  7. $right_eye_cylinder = $_POST['right_eye_cylinder'];
  8. $left_eye_cylinder = $_POST['left_eye_cylinder'];
  9. $right_eye_axis = $_POST['right_eye_axis'];
  10. $left_eye_axis = $_POST['left_eye_axis'];
  11. $pd = $_POST['pd'];
  12. $date_of_birth = $_POST['date_of_birth'];
  13. $file_path = $_POST['file_path'];
  14.  
  15. $add_query = "INSERT INTO wew_prescription (
  16. prescription_id,
  17. user_id,
  18. prescription_name,
  19. date_created,
  20. last_updated,
  21. right_eye_sphere,
  22. left_eye_sphere,
  23. right_eye_cylinder,
  24. left_eye_cylinder,
  25. right_eye_axis,
  26. left_eye_axis,
  27. pd,
  28. date_of_birth,
  29. file_path
  30. ) Values (
  31. NULL,
  32. {$user_id},
  33. '{$prescription_name}',
  34. '{$date_created}',
  35. '{$last_updated}',
  36. '{$right_eye_sphere}',
  37. '{$left_eye_sphere}',
  38. '{$right_eye_cylinder}',
  39. '{$left_eye_cylinder}',
  40. '{$right_eye_axis}',
  41. '{$left_eye_axis}',
  42. '{$pd}',
  43. '{$date_of_birth}',
  44. '{$file_path}'
  45. )";
  46.  
  47. $sql = $dbCon->query($add_query);
  48.  
  49. if (!mysqli_query($dbCon,$sql)){
  50. die('Error: ' . mysqli_error($dbCon));
  51. }else{
  52. mysqli_query($dbCon,$sql);
  53. echo "dados atualizados!";
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement