Heeelo peeps, its a complex one, so stick with me on this.....
I have a page which is a form, that allows you to edit certain aspects of a record. There are two submit buttons 'recalculate' and 'end'. End takes you back to the main page, while 'recalculate' updates the database with submitted values and then redisplays the form with the new values.
the problem is with recalculate, in that it loses the ID of the record and shows blank.
Also gives error - DBquery:SQL() DB Error: value count on row
Here is some code!
session_start(); require("gcdb.php"); require("security/hybrid.php"); adminify($sess_user, $_SESSION['sess_admin']); beginDocument($lEnterTicket, $_SESSION['sess_admin']); $db = getDBConnection(); if(session_is_registered("sess_user")) { if($_POST['action'] == "recalculate") { $result = DBquery("UPDATE estimatecommon SET OriginationHourly='$_POST[OriginationHourly]', OriginationHours = '$_POST[OriginationHours]', TotalOrigination='$_POST{TotalOrigination]' Where TicketID = '$_POST[TicketID]'", $db); checkDBError($db); $now = date("Y-m-d"); $nowtime = strftime("%H:%M:%S"); # $result = DBquery("SELECT * FROM Configuration", $db); # $config_row = DBfetch_array($result); $result = DBquery("SELECT * FROM Tickets WHERE TicketID='$_POST[TicketID]'", $db); $udata_row = DBfetch_array($result); $estimateData = DBquery("Select * FROM estimatecommon WHERE TicketID='$_POST[TicketID]'", $db);
Any ideas welcome!
Emma