Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. fuction.php
  2.  
  3. <?php
  4. function getShop($Type, $limit)
  5. {
  6. /*This Function, connects to the database Virtual Campus and retrieves the video with the corresponding input paramter. */
  7. $dbconn = pg_connect("host=localhost port=5432 dbname=sdfds user=dsfd password="dgdsf")
  8. or die('Could not connect: ' . pg_last_error());
  9.  
  10. echo "<b>conected to Database</b>";
  11. echo "</br>";
  12. echo "</br>";
  13. $videoquery = "SELECT st_x(transform(PP.way, 4030)) as longitude , st_y(transform(PP.way, 4030)) as latitude
  14. from planet_osm_point PP, shop SP
  15. where PP.osm_id = SP.osm_id
  16. AND SP.type = '$Type'
  17. limit $limit;";
  18.  
  19. $result = pg_query($videoquery) or die('Query failed: ' . pg_last_error());
  20. $coord = pg_fetch_array($result, null, PGSQL_ASSOC);
  21.  
  22. index.php
  23.  
  24. <?php global $ShopType; Global $ShopLimit; $ShopType = $_GET['TypeShops']; $ShopLimit = $_GET['NumberShops'];
  25. $getShopType = getShop($ShopType, $ShopLimit);//$_POST['TypeShops'] ;
  26. print_r($getShopType);
  27.  
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement