Skip to content
Advertisement

INSERT INTO – Subquery returns more than 1 row (PHP/MySQL)

I’m trying to develop a website with PHP and MySQL. Here is my PHP code I tried:

My $this->db_inventory variable is connected with an DB API. There is no issue with it. But when I execute the code up here returns me this:

I searched this issue on here (stackoverflow) but in all issues have SELECT statement in their queries. I didn’t give any SELECT statement in my INSERT INTO query. How could it be possible?

Edit (Due to comments)

Here is my Execute()

And RecordSet

Advertisement

Answer

Solved!

In my database I also have a table called request_components. And it had 2 primary key: id and request_list_id. After deleting request_list_id key from table, the problem solved. It seems to creating conflict between tables. If you had this problem, you should check your database.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement