This is a discussion on Best query for a path or parts thereof within the MySQL Database forums, part of the Database Forums category; Hi, I want to search for my current directory or parents of my directory. So if my path is, http://...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi, I want to search for my current directory or parents of my directory. So if my path is, http://www.example.com/patha/pathb/ my path is '/patha/pathb/' I could do SELECT * FORM TABLE A WHERE path='/patha/pathb/' SELECT * FORM TABLE A WHERE path='/patha/' or even SELECT * FORM TABLE A WHERE path='/patha/pathb/' OR path='/patha/' but I was wondering if there was a better, more efficient way of doing it? How would you design the table for such a path? The 'path' is unique and there is only ever one of each, (but there could be an entry for '/patha/pathb/' and '/patha/' Thanks FFMG -- 'webmaster forum' (http://www.httppoint.com) | 'Free Blogs' (http://www.journalhome.com/) | 'webmaster Directory' (http://www.webhostshunter.com/) 'Recreation Vehicle insurance' (http://www.insurance-owl.com/other/car_rec.php) | 'Free URL redirection service' (http://urlkick.com/) ------------------------------------------------------------------------ FFMG's Profile: http://www.httppoint.com/member.php?userid=580 View this thread: http://www.httppoint.com/showthread.php?t=21522 Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing). |