php - MySQL Raw and Column Combined Fetch

Solution:
Why not just create another table for identifying the type of attached documents?
{-code-8}:
Then, add another column on your{-code-2}
, which will be named for example -{-code-3}
:
id | customer_id | {-code-3} | issuedate | validity_date |
----+
Answer
(Though you have{-code-5}
column already for your{-code-2}
, which were not explained on how you use it. I'm assuming that this column is only in a text format)
Then, create a join query:
SELECT a.validity_date, a.status, b.doc_type_desc
FROM {-code-2} a
LEFT JOIN {-code-8} b ON a.{-code-3} = b.{-code-3}
WHERE a.user_id = '$id'
With this approach, you can just create a new type of document in your{-code-8}
for a "dynamic/more future-proof" approach of your system (in case you want to add more document for each user)
On a side note, please defer from using the deprecated and use
instead.
Answer
Answer
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: apache/2.4.52 (win64) openssl/1.1.1m php/8.1.2 server at localhost port 80
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.