Advertisement
Guest User

vipok

a guest
May 15th, 2019
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. ---------------------------------------------------------------------------------------------------
  2. Funkcja:
  3. ---------------------------------------------------------------------------------------------------
  4. public function saveDataToDB($fileNameToSave, $logoType, $id, $ses_id)
  5. {
  6. global $pdo;
  7. $stmt = $pdo->prepare("UPDATE a_temp_session
  8. SET {$logoType} = :value
  9. WHERE session_id = :session_id AND id=:id");
  10.  
  11. $stmt->bindValue(":session_id", $ses_id);
  12. $stmt->bindValue(":id", $id);
  13. $stmt->bindValue(":value", $fileNameToSave);
  14. $stmt->execute();
  15. }
  16. ---------------------------------------------------------------------------------------------------
  17. Wywołanie + else, który się wykonuje
  18. ---------------------------------------------------------------------------------------------------
  19. if( $this->saveDataToDB($fileNameToSave, $logoType, $id, $ses_id) )
  20. {
  21. echo '{"status":1,"data":null,"error":[]}';
  22. }
  23. else
  24. {
  25. echo '{"status":0,"data":null,"error":["Wystąpił błąd"]}';
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement