Topic: database error

The sql query can run correctly on the mysql older version i.e. 4.12 while it gives error when they are running on mysql version like 5+.


Query:
"INSERT INTO ".TB_PREF."stock_moves (stock_id, trans_no, type, loc_code,
        tran_date, person_id, reference, qty, standard_cost, visible, price,
        discount_percent) VALUES ('$stock_id', $trans_no, $type, 
        '$location', '$date', '$person_id', '$reference', $quantity, $std_cost,
        $show_or_hide, $price, $discount_percent)";

It is explanation : Where $person_id = null

Re: database error

The query you are referring to is inside /includes/db/inventory_db.inc in function add_stock_move().

The value of $person_id = null is among other in Manufacturing, work order entry.
I can NOT reproduce an error. The value of the person_id field is 0 after execution.
I am using PHP 5.2.4 and MySQL 5.0.18.

/Joe