Best query for a path or parts thereof

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://...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-24-2007
FFMG
 
Posts: n/a
Default Best query for a path or parts thereof


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).

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:30 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0