Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $host="localhost";
- $username="root";
- $password="sunbuggy";
- $database="mpg";
- $table="m";
- mysql_connect($host,$username,$password) or die( "unable to connect to mysql server");
- mysql_select_db($database) or die( "Unable to select database");
- $driver=$_POST['driver'];
- $shuttle=$_POST['shuttle'];
- $gas=$_POST['gas'];
- $miles=$_POST['miles'];
- $cost=$_POST['cost'];
- $getlastpri= "(SELECT * FROM '$table' ORDER BY `prikey` DESC)";
- $sql=mysql_query($getlastpri);
- $i=0;
- $num=mysql_result($prime,$i,$prikey);
- $shut=NULL;
- while ($shut != $shuttle){
- $shut=mysql_result($sql,$i,shuttle);
- $i++;}
- if($shut == $shuttle)
- {$pastmiles=mysql_result($sql,$i,miles);}
- else
- $pastmiles=Null;
- if($pastmiles=Null):
- {$milestravled=Null;}
- else:
- $milestravled=$miles-$pastmiles;
- $milespergallon=($milestravled/$gas);
- $abc= "INSERT INTO $table VALUES ('','$driver','$shuttle','$gas','$miles','$cost', '$milestravled','$milespergallon')";
- mysql_query($abc);
- mysql_close();
- echo "Your latest information has been input into the server";
- ?>`
- $getlastpri= "(SELECT * FROM '$table' ORDER BY `prikey` DESC)";
- $getlastpri= "SELECT * FROM `$table` ORDER BY `prikey` DESC";
- if($pastmiles=Null):
- {$milestravled=Null;}
- else:
- if($pastmiles == Null){
- $milestravled=Null
- }
- <?
- if($a):
- echo $a;
- if($b) {
- echo $b;
- }
- else:
- echo $c;
- endif;
- ?>
- if($pastmiles=Null):
- {$milestravled=Null;}
- else:
- $milestravled=$miles-$pastmiles;
- if (NULL == $pastmiles)
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement