in reply to Unexplained MySQL Error

What gets returned when your table is created/populated with a "parent" column and you use the mysql shell to run the query  "SELECT parent FROM categories WHERE id=1"?

Might the record with "id=1" be one that has "no parent" (i.e. a null value in this column)? If so, might it be someplace else in your perl code (where maybe you try to use the value returned by this query in some subsequent query) that is actually generating the error message (because you're using an empty string where you need a non-empty one)?