From anonymous, 1 Month ago, written in PHP.
This paste will kick the bucket in 9 Months.
Embed
  1. <?php
  2.  
  3. // Get the last ticket number entry on specific Service ID
  4. $sql = "SELECT * FROM `queues` WHERE `ServiceID` = '".$serviceId."'";
  5. $result = $con->query($sql);
  6. $lastTicketNum = $result['TicketNumber'];
  7.  
  8. // Increment it with one for the new entry
  9. $newTicketNum = $lastTicketNum + 1;
  10.  
  11. // Insert the new queue data in the database table
  12. $sql = "INSERT INTO `queues` (`QueuedID`, `ServiceID`, `CustomerID`, `TicketNumber`, `Called`, `Missed`, `CreateDateTime`)
  13. VALUES (NULL, '".$serviceId."', '".$customerId."', '".$newTicketNum."', 0, 0, CURRENT_DATETIME)";
  14.  
  15. // Determine error or success
  16. if ( $con->query($sql) )
  17.     $data['status'] = 'success';
  18. else
  19.     $data['status'] = 'error';
  20.  
  21. // Set data array into JSON output
  22. echo json_encode( $data );

Replies to Untitled rss

Title Name Language When
Re: Untitled anonymous php 1 Month ago.