PDA

View Full Version : including a row in SQL results based on references within string



Keysle
28 Dec 2011, 02:44 PM
Here is what my table looks like

postID|Message
1| I can't wait to get STARTED!!!!
2| @1 dude, you're way to hyped
3| Everyone ignore this guy --> @2
4| @3 Why ignore me?

is it possible to do a query where I can fetch all comments chained to post #4?
Conceptually:
if I ask for things chained to #4 the mysql will see "@3" (with the symbol '@') and include that in the results, but it will also look at post #3 and include post 2 because of the "@2" included... and all the way down to 1.

Is it possible to do this with 1 mySql query?

I can specify the targeted posts in a different field if I need to ( It's possible to have multiple post references though)

SEOT: 7gNI4bk8OeuPJmaWpb2u

hamid
29 Dec 2011, 12:58 AM
At Rangpursoft we pride ourselves on being able to help our clients with all their needs. Not only will we design top quality websites but we can also help you move your business forward. We are aware that all business needs marketing and for that reason we can help with all elements of your marketing from SEO to leafleting. In addition we can help you with all your print needs. As well as designing all of your business stationary and marketing material we can arrange printing and have the products delivered directly to your door. We are aware that every client has different needs and we aim to give a personal service and exactly tailor a package for each client's needs. By doing this we are able to build long standing relationships with clients that last for many years.