Awarded

SQL - get all category parents of final child

I am in need of a php sql query to a mysql database.

I need the shortest amount of code possible and it cannot involve triggers.

There are two tables. item_id and parent_id

Armed with only the final child item_id and its own parent_id, I must be able to trace its ancestry to the root parent_id which is 0.

In the image I am supplying with this job post, you will see the arrows trace the steps I would want to receive. In this example, if armed only with the knowledge the item_id='Motherboard Repair',

Your php query results should trace upwards and reveal a parent category structure of:

'0 \ Computer & Consumer Electronics \ Computers \ Computer Repair \ Motherboard Repair'

I am also attaching an sql export table in a zip file in case you wish to practice in advance.

Thank you.

Jay

CompuMatter

Skills: MySQL, PHP, Software Architecture

See more: sql parents, mysql parents, php category parents, the final results, job category, trace image, sql software, SQL Query, Sql 2012, parents, JAY, php sql code, sql final, php mysql sql example, advance computer, php mysql trace, mysql export table sql, image query, export sql, mysql repair database, php sql image, computer repair php, motherboard mysql, sql computer repair, php triggers

About the Employer:
( 57 reviews ) Anacortes, United States

Project ID: #2528347

8 freelancers are bidding on average $59 for this job

gslogics123

ready with demo in an hour!

$50 USD in 0 days
(180 Reviews)
7.1
pablotorres

i can do it

$30 USD in 5 days
(59 Reviews)
5.2
webedict

HELLO SIR, LETS START AND FINISH IT ASAP. I HAVE 4 YEARS OF EXPERIENCE IN WEB DEVELOPMENT FILED ( php, mysql ). THANKS !!

$50 USD in 2 days
(56 Reviews)
5.1
Bistechsupport

Hi, This is jeni from Bistechsupport. Thanks for placing my bid on this lovable project. Yes we could able to do this wordpress project. A very samples of our works are listed over here for your referen More

$135 USD in 5 days
(18 Reviews)
4.4
saviits

sir, Have 7+ years of experience in SQL. Check your inbox for an immediate solution.

$30 USD in 1 day
(2 Reviews)
3.1
puneethmech

Plz chek PM

$30 USD in 2 days
(1 Review)
2.5
julianmc90

hi man, i'm finishing it so are you online??

$100 USD in 1 day
(0 Reviews)
0.0
esia168

Hi, I am eager and can do this for you :)

$50 USD in 2 days
(0 Reviews)
0.0