07-19-2017, 11:59 PM,
(This post was last modified: 07-20-2017, 12:48 AM by sunshinelock.)
|
|
Database Error 1364 Field 'narrative'
Well, I guess my host upgraded MySQL and now I'm popping up errors here and there.
If I go into an inventory item and click "Quantity Adjustments" and enter the usual things that need adjusting, after several seconds I get the following error:
Database Error 1364 : CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE: The stock movement record cannot be inserted because
Field 'narrative' doesn't have a default value
Database SQL Failure : The following SQL to insert the stock movement record was used
INSERT INTO stockmoves (stockid, type, transno, loccode, trandate, userid, prd, reference, qty, newqoh, standardcost) VALUES ('SAMPLESTOCKCODE', 17, '4347', 'SAMPLELOCATION', '2017-07-19', 'USERNAME', '131', 'Counted and missing', '-1', '0', '1.105')
Database Rollback Due to Error Above : Rolling Back Transaction OK
Running 4.13.1
Problem fixed...
I had to log into phpMyAdmin (MySQL backend) and in table "stockmoves" I clicked on "narrative" and changed the default from "None" to "NULL". Seems to be working now.
|
|
07-20-2017, 06:20 AM,
|
|
TimSchofield
Tim Schofield
|
Posts: 1,318
Threads: 22
Joined: Mar 2015
|
|
RE: Database Error 1364 Field 'narrative'
Your fix works, but to fix the sql the query at Line 213 should be:
$SQL = "INSERT INTO stockmoves (stockid,
type,
transno,
loccode,
trandate,
userid,
prd,
reference,
qty,
newqoh,
standardcost,
narrative)
VALUES ('" . $_SESSION['Adjustment' . $identifier]->StockID . "',
17,
'" . $AdjustmentNumber . "',
'" . $_SESSION['Adjustment' . $identifier]->StockLocation . "',
'" . $SQLAdjustmentDate . "',
'" . $_SESSION['UserID'] . "',
'" . $PeriodNo . "',
'" . $_SESSION['Adjustment' . $identifier]->Narrative ."',
'" . $_SESSION['Adjustment' . $identifier]->Quantity . "',
'" . ($QtyOnHandPrior + $_SESSION['Adjustment' . $identifier]->Quantity) . "',
'" . $_SESSION['Adjustment' . $identifier]->StandardCost . "',
'')";
This is caused by the sql_mode issue I mentioned in answer to your other post.
Tim
|
|
|