Jump to content

[SOLVED] PHP Insert Help


jfs0479

Recommended Posts

Hi Guys

 

Im having this porblem with a script where it is completly resisting to insert the data into the mysql database. I know in the example below i havent used all of the variables i set but i wanted to see if it would work without it! Thanks :)

 

<?php
require 'cookie.php';
include("db.php");


$departingicao = $_POST['departingicao'];
$arrivingicao = $_POST['arrivingicao'];
$query = "SELECT departing, arriving FROM arab_routes WHERE departingicao='$departingicao' AND arrivingicao='$arrivingicao' LIMIT 1";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
			$departing = $row['departing'];
			$arriving = $row['arriving'];
$date = $_POST['date'];
$date2 = explode("/", $date);
$newdate = $date2[2].$date2[1].$date2[0]."000000";
$today = strtotime($newdate);

$pax = $_POST['pax'];
$fuelused = $_POST['fuelused'];
$machspeed = $_POST['machspeed'];
$aircraft = $_POST['aircraft'];
$reg = $_POST['reg'];
$routeid = $_POST['routeid'];
$routetaken = $_POST['routetaken'];
$comments = $_POST['comments'];
$hours2 = $_POST['hours'];
$minutes2 = $_POST['minutes'];
$hour2 = "60";
$hour = $hour2 * $hour2;
$hseconds = $hours2 * $hour;
$secs = "60";
$mseconds = $minutes2 * $secs;
$total = $mseconds + $hseconds;
$vatsim = $_POST['vatsim'];

mysql_query("INSERT INTO arab_flights 
(departing, departingicao, arriving, arrivingicao) VALUES('$departing', '$departingicao', '$arriving', '$arrivingicao' ) ") 
or die(mysql_error()); } ?>

Link to comment
https://forums.phpfreaks.com/topic/68877-solved-php-insert-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.