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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.