Advertisement
Guest User

Untitled

a guest
Aug 10th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. getProductIDHistoryRequest
  2. {
  3. product_id_list(Array[String])
  4. }
  5.  
  6. getProductIDHistoryResponse
  7. {
  8. product_id_history_list(Array[Product_id_history]),
  9. status(int),
  10. message(String)
  11. }
  12. Product_id_history
  13. {
  14. old_code(String),
  15. new_code(String),
  16. log_date(Timestamp),
  17. m_id(String)
  18. }
  19.  
  20. example=# select * from test.ex where id=329169 or id=329167;
  21. id | m_id | old_code | new_code | log_date
  22. --------+----------+-----------+-----------+----------------------------
  23. 329167 | 42136827 | 220215960 | 234024343 | 2018-08-09 18:40:02.37479
  24. 329169 | 603990 | 220088542 | 234024341 | 2018-08-09 18:40:05.655615
  25. (2 rows)
  26.  
  27. <!DOCTYPE html>
  28. <html>
  29. <body>
  30.  
  31. <h2>Test</h2>
  32.  
  33. <p id="demo"></p>
  34.  
  35. <script>
  36. var obj, dbParam, xmlhttp, myObj, x, txt = "";
  37. obj = { "id":329167};
  38. dbParam = JSON.stringify(obj);
  39. xmlhttp = new XMLHttpRequest();
  40. xmlhttp.onreadystatechange = function() {
  41. if (this.readyState == 4 && this.status == 200) {
  42. document.getElementById("demo").innerHTML = this.responseText;
  43. }
  44. };
  45. xmlhttp.open("GET", "test.php?x=" + dbParam, true);
  46. xmlhttp.send();
  47.  
  48. </script>
  49.  
  50. <p>TEST</p>
  51.  
  52. </body>
  53. </html>
  54.  
  55. <?php
  56. header("Content-Type: application/json; charset=UTF-8");
  57. $obj = json_decode($_GET["x"], false);
  58.  
  59. $conn = pg_connect("host=111.11.11.11 dbname=example user=test2 password=testpass");
  60. $result = pg_query("SELECT * FROM test.ex where id=".$obj->id);
  61.  
  62. ...
  63.  
  64. // Closing connection
  65. pg_close($dbconn);
  66. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement