source: src/django_gheat/db/random_to_db.php@ 9060

Last change on this file since 9060 was 9045, checked in by dennisw, 14 years ago

tijdelijke data invoer scripts toegevoegd

File size: 709 bytes
Line 
1<?php
2
3// edit with personal settings
4$location = ' ';
5$username = ' ';
6$password = ' ';
7$database = ' ';
8
9// connect to database
10mysql_connect($location, $username, $password)
11 or die("Error connecting to mysql: " . mysql_error());
12mysql_select_db($database)
13 or die("Error connecting to database: " . mysql_error());
14
15// generate random points and insert into database
16for($i=0;$i<10000;$i++) {
17 $lat = "52.".rand(140252,167846);
18 $lon = "4.".rand(459019,514637);
19 $sgnl = rand(1,100);
20 $query=mysql_query("INSERT INTO gheat_meting (latitude, longitude, signaal) VALUES ('$lat','$lon', '$sgnl')");
21 if (!$query) {
22 die('Invalid query: ' . mysql_error());
23 }
24}
25
26echo 'done';
27
28?>
Note: See TracBrowser for help on using the repository browser.