Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $connect = mysql_connect("localhost","root","") or die ("Couldn't connect!");
- $createdb = mysql_query ("CREATE DATABASE detection");
- mysql_select_db("detection") or die ("Couldn't find db");
- $createtable = mysql_query ("
- CREATE TABLE IF NOT EXISTS `nodes` (
- `nodid` int(5) NOT NULL AUTO_INCREMENT,
- `index1` int(3) NOT NULL,
- `index2` int(3) NOT NULL,
- `x` double NOT NULL,
- `y` double NOT NULL,
- PRIMARY KEY (`nodid`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=401 ;
- ");
- //create nodes table
- $nod=1;
- $nod1=1;
- $x=1;
- $y=1;
- while ($nod <= 10 )
- {
- while ($nod1 <=10)
- {
- $x=$x+(rand(1,5)/10);
- $y=$y+(rand(1,5)/10);
- echo "$nod-$nod1-$x-$y"."***";
- $queryinsertrow = mysql_query ("
- INSERT INTO nodes VALUES (' ', '$nod', '$nod1', '$x', '$y')
- ");
- $x=$x-(rand(1,5)/10);
- $y=$y-(rand(1,5)/10);
- $nod1++;
- $x=$x+50;
- }
- echo "<br>";echo "<br>";
- $nod++;
- $y=$y+50;
- $nod1=1;
- $x=0;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement