Advertisement
DubStepMad

Notes Update

Apr 23rd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. $UpdateN = 'INSERT INTO notes (uid, staff_name, name, alias, note_text, warning)'
  2. . ' VALUES ( ?, ? , ? , ? , ? , ? )';
  3.  
  4. if( $sth = mysqli_prepare($dbcon,$UpdateN) ) {
  5. mysqli_stmt_bind_param($sth,'ssssss'
  6. ,$_POST['hidden']
  7. ,$user
  8. ,$player->name
  9. ,$player->aliases
  10. ,$_POST['note']
  11. ,$_POST['warn']
  12. );
  13. if( mysqli_stmt_execute($sth) ) {
  14. // statement execution successful
  15. } else {
  16. printf("Error: %s\n",mysqli_stmt_error($sth));
  17. }
  18. } else {
  19. printf("Error: %s\n",mysqli_error($dbcon));
  20. }
  21.  
  22. $UpdateN2 = 'UPDATE players SET warning = warning + ? WHERE playerid = ? ';
  23.  
  24. if( $sth2 = mysqli_prepare($dbcon,$UpdateN2) ) {
  25. mysqli_stmt_bind_param($sth2,'ss'
  26. ,$_POST['warn']
  27. ,$_POST['hidden']
  28. );
  29. if( mysqli_stmt_execute($sth2) ) {
  30. // statement execution successful
  31. } else {
  32. printf("1Error: %s\n",mysqli_stmt_error($sth2));
  33. }
  34. } else {
  35. printf("2Error: %s\n",mysqli_error($dbcon));
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement