Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getProductIDHistoryRequest
- {
- product_id_list(Array[String])
- }
- getProductIDHistoryResponse
- {
- product_id_history_list(Array[Product_id_history]),
- status(int),
- message(String)
- }
- Product_id_history
- {
- old_code(String),
- new_code(String),
- log_date(Timestamp),
- m_id(String)
- }
- example=# select * from test.ex where id=329169 or id=329167;
- id | m_id | old_code | new_code | log_date
- --------+----------+-----------+-----------+----------------------------
- 329167 | 42136827 | 220215960 | 234024343 | 2018-08-09 18:40:02.37479
- 329169 | 603990 | 220088542 | 234024341 | 2018-08-09 18:40:05.655615
- (2 rows)
- <!DOCTYPE html>
- <html>
- <body>
- <h2>Test</h2>
- <p id="demo"></p>
- <script>
- var obj, dbParam, xmlhttp, myObj, x, txt = "";
- obj = { "id":329167};
- dbParam = JSON.stringify(obj);
- xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- document.getElementById("demo").innerHTML = this.responseText;
- }
- };
- xmlhttp.open("GET", "test.php?x=" + dbParam, true);
- xmlhttp.send();
- </script>
- <p>TEST</p>
- </body>
- </html>
- <?php
- header("Content-Type: application/json; charset=UTF-8");
- $obj = json_decode($_GET["x"], false);
- $conn = pg_connect("host=111.11.11.11 dbname=example user=test2 password=testpass");
- $result = pg_query("SELECT * FROM test.ex where id=".$obj->id);
- ...
- // Closing connection
- pg_close($dbconn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement