MySQL Forums
Forum List  »  Newbie

How do I create rows from an array to create a view in phpMy Admin - mySql
Posted by: Debbie Shaw
Date: December 08, 2021 06:21AM

This is my table:

| meta_ID | post_id | Meta_key | Meta_Value |
| -------- | -------------- | --------------------- | --------------------- |
| 1 | 5510 | tourmaster-tour-date | 2022-07-18,2022-07-25 |
| 2 | 6099 | tourmaster-tour-date | 2022-07-18,2022-07-25 |
| 3 | 6208 | tourmaster-tour-date | 2022-05-09,2022-08-18 |



What query do I need to use to select the following rows to allow me to create a database view like this?

| post_id | Meta_key | Meta_Value |
| -------------- | --------------------- | --------------------- |
| 5510 | tourmaster-tour-date | 2022-07-18 |
| 5510 | tourmaster-tour-date | 2022-07-25 |
| 6099 | tourmaster-tour-date | 2021-12-27 |
| 6099 | tourmaster-tour-date | 2022-01-27 |
| 6208 | tourmaster-tour-date | 2022-05-09 |
| 6208 | tourmaster-tour-date | 2022-08-18 |

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.