I'm trying to build url's from Word Press Post/Pages. I'm able to connect to the database and retrieve the data I need. However some pages have parents, which are just other pages, for example:
|id|post_name|post_parent|post_status|url
|1 |post_1 |0 |publish |post_1
|2 |post_2 |3 |publish |post_3/post2
|3 |post_3 |0 |draft |post_3
What I want to be able to do is build the url column using a MySQL query. At the moment I'm using some c# code to do it, however this should be possible using SQL? The version of MySQL is 14.14 Distrib 5.1.73. I don't have any control over the version of MySQL.