gavwvin
Thanks for looking at the code.
Yes, the variables $Category and $SubCategory do contain values "test" and "subtest" as shown on the printout of the $sqlquery for diagnostic purposes.
print($sqlquery);
Results printed:
INSERT INTO Category (ID, Category, SubCategory) VALUES ("", "test", "subtest")
Honestly, I wouldn't have asked for help unless I was stumped and believe me, I'm stumped!
It all looks like good code and I even took it from another page used on another web site which does not add the additional record. [OK, that's cheating but the way I see it, a good programmer does not reinvent the wheel when one is out there!]
I've compared the two pages and see no obvious differences other than fieldnames. Also, I've compressed, rebuilt, deleted and recreated the tables with no effect.
I don't want to do it but if I can't find the problem, I'm probably going to add a routine built in at the time of listing that if a record is found with blank data in both fields, then to just delete the record on the fly. It's sloppy but at least it keeps the client from having to delete blank records.
If you see anything let me know.
Luke