This topic is locked

remove record after job is complete

5/14/2019 12:29:16 PM
PHPRunner General questions
S
stanbar1 author

Hello. I have table AdminJobs and 5 CustomView Tables:

id,

CompanyName,

ChauffeurName,

ChauffeurShortName,

ChauffeurE-Mail,

Job,

Date,

JobDay,

Misc,

PassengerName,

Extras,

MittingArea,

AddStop1,

AddStop2,

AddStop3,

AddStop4,

Cars,

PassengerQuantity,

Fare,

NoShow,

Confirmation,

AirportName,

AirportCode,

AirlineName,

AirlineCode,

AirlineCountry,

AirlineDoorNumber,

FlightNumber,

ArlineInfo,

AirlinePickUp,

AirportName1,

AirportCode1,

AirlineName1,

AirlineCode1,

AirlineCountry1,

FlightNumber1,

AirlineDoorNumber1,

ArlineInfoDo,

AirlineDropOff,

PortName,

PortCode,

CruiseLine,

CruiseLineCode,

ShipName,

Terminal,

PortPickUp,

PortName1,

PortCode1,

CruiseLine1,

CruiseLineCode1,

ShipName1,

Terminal1,

PortDropOff,

HotelName,

BuildingNumber,

StreetName,

City,

State,

ZipCode,

HotelPickup,

HotelName1,

BuildingNumber1,

StreetName1,

City1,

State1,

ZipCode1,

HotelDropOff,

RideDetails,

SpecialReguirments,

Quantity,

Name,

CurrentStatus,

Time,

CurrentStatus1,

Time1,

CurrentStatus2,

Time2,

CurrentStatus3,

Time3,

Hourly,

FareByHour,

WatingTime,

Picture,

Express Line,

Tolls,

Parking,

Comments,

Completed,

DateCompleted,

ForDate,

ForPassenger,

ForPickUp,

ForDropOff,

ForCar,

ForFlight,

ForStatus,

ForPassengers,

ForCurrency,

ForMisc,

ForExtras,

ForConfirmation,

ForRideDetails,

ForMitting

FROM AdminJobs

I need when my drivers completed job, remove from AdminJobs and move to table:JobsHistory..can you Please Help me. I try use code event after update:

$sql = "delete from AdminJobs where id_Job= ".$values['id_Job'];

CustomQuery($sql);
$sql = "INSERT INTO JobsHistory (id_Job, id_PassengerName,Date) values ($id_Job, ".$values['id_PassengerName'].",'".$Date."')";

CustomQuery($sql);

it's don't work.

M
mrl40 5/16/2019

You may need to swop the statements around

You are trying to insert a record into a table from another table where it has already being deleted
Try inserting record first and then deleting it.