Jump to content

2 tables


Crew-Portal

Recommended Posts

Hi I need to know how to get this line of code:

$sql="INSERT INTO flights (PilotName, FlightDate, AircraftName, NbrPassengers, CargoWeight, DepartureIcaoName, ArrivalIcaoName, TotalDistance, TotalBlockTime, money) VALUES ('CMX-$valid_user', $time, '$_POST[plane]',

'$passengersrand', '$cargorand Lbs', '$strd', '$stra', '$_POST[distance] NM', '$_POST[hour]:$_POST[minute]', '$money_main')";

$error = $tblstart . 'Flight Sucessfully Posted!' . $tblend;

include_once($index);

and this line of code:

UPDATE user SET distance=distance+($_POST[distance]) WHERE user=$valid_user";

to work at the same time! Because I need the information to go to 2 tables at the same time and I do not know how to do this. could someone help me out?

Link to comment
Share on other sites

ah that hurts my head. Can someone please just help me. I dont need rollback as I believe that resets my previous command! idk how to do this. I got so far but I think I know where to draw the line in the sand! This is the only part Im stuck on so if I could just get straight up help I would very much so appreciate it!

Link to comment
Share on other sites

$sql="INSERT INTO flights (PilotName, FlightDate, AircraftName, NbrPassengers, CargoWeight, DepartureIcaoName, ArrivalIcaoName, TotalDistance, TotalBlockTime, money) VALUES ('CMX-$valid_user', $time, '$_POST[plane]',

'$passengersrand', '$cargorand Lbs', '$strd', '$stra', '$_POST[distance] NM', '$_POST[hour]:$_POST[minute]', '$money_main'); rollback; commit; UPDATE $tbl_user SET distance=distance+($_POST[distance]) WHERE user=$valid_user";

 

doesnt work and I tried like 10 other ways I could think of after reading that html script but I still dont know?

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.