Jump to content

column cannot be null


The Little Guy

Recommended Posts

I have this multi query:

LOCK TABLE categories WRITE;

SELECT @myRight := rgt FROM categories WHERE parent = '$parent';

UPDATE categories SET rgt = rgt + 2 WHERE rgt > @myRight;
UPDATE categories SET lft = lft + 2 WHERE lft > @myRight;

INSERT INTO categories(name, parent, lft, rgt) VALUES ('$value', $parent, @myRight + 1, @myRight + 2);

UNLOCK TABLES;

 

I am getting the following error when I do the insert:

 

#1048 - Column 'lft' cannot be null

 

What am I doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/199346-column-cannot-be-null/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.