jfs0479 Posted September 11, 2007 Share Posted September 11, 2007 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 More sharing options...
pocobueno1388 Posted September 11, 2007 Share Posted September 11, 2007 Whats the error your getting? Link to comment https://forums.phpfreaks.com/topic/68877-solved-php-insert-help/#findComment-346167 Share on other sites More sharing options...
jfs0479 Posted September 11, 2007 Author Share Posted September 11, 2007 There isnt any error message being given, and the connections to the db is perfect Link to comment https://forums.phpfreaks.com/topic/68877-solved-php-insert-help/#findComment-346168 Share on other sites More sharing options...
almightyegg Posted September 11, 2007 Share Posted September 11, 2007 Try this... $variable = 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/#findComment-346169 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.