Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Storing of Row labelled as "problematic"

$
0
0

Hello

 

If we had multiple tables which hold data to be processed

IMAGE
+----+-----------+  
| id |   image   |
+----+-----------+
| 4  | test.png  |
| 5  | bird.png  |
+----+-----------+

ORDER
+----+-----------+
| id |   order   |
+----+-----------+
| 4  | 100000045 |
| 5  | 100000046 |
+----+-----------+

When a processing error occurs, I thought to move the row to a table called error/attention/concern etc, To keep the table clean.

 

Which would look something like this.

ERROR
+----+-----------+----------+-----------+
| id | table_id  |  image   |   order   |
+----+-----------+----------+-----------+
| 1  |  4        | test.png |   EMPTY   |
| 2  |  5        |  EMPTY   | 100000046 |
+----+-----------+----------+-----------+

However, This table will have to have corresponding columns for IMAGE and ORDER, But then we have a problem of storing empty/null values for the columns which are not needed on insertion here, This does not seem right.

 

Has anybody had a similar issue before like this? Im sure there maybe a more definitive way of doing this.

I also thought possibly just have 2 rows here, and enter a serialized array of data, but that seems even worse than this.

 

Or finally I could possibly make 2 more tables, IMAGE_ERROR, ORDER_ERROR.

But upon adding new processing technologies, I would need to add 2 new tables each time.

 

Thanks in advance for any help/advice/answers.

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles