|
-
Mar 14th, 2003, 01:16 PM
#1
Thread Starter
Lively Member
MySQL Search... (Resolved)
This is a really basic, stupid question, but I can't find any website which will bloody answer the question.. it's all advanced stuff, and is well beyond my ability to grasp.
I have a SQL database called "downloads". There's several tables, one of which is "filename" and one of which is "downloads". Obviously, it's a download counter.
I'm trying to write a query that'll search the database and return the "downloads" value based on a single filename.
The standard query it uses is..
SELECT * FROM downloads ORDER BY downloads DESC
But that generates everything.
How would I just simply return the value of "downloads" where "filename" is blah, in table "downloads"?
Thanks.
Last edited by Daschle; Mar 18th, 2003 at 07:25 PM.
"It's difficult to imagine a world in which people voluntarily choose to listen to liberals. There is no evidence that it has ever happened. " - Ann Coulter
-
Mar 14th, 2003, 03:39 PM
#2
Stuck in the 80s
Is this what you mean?:
Code:
SELECT * FROM downloads WHERE filename='blah.exe' ORDER BY downloads DESC
Sorry if I'm not understanding correctly.
-
Mar 18th, 2003, 08:46 AM
#3
Frenzied Member
This is a really basic, stupid question, but I can't find any website which will bloody answer the question.. it's all advanced stuff, and is well beyond my ability to grasp
then how can it be a basic, stupid question if you think it is all advanced stuff?? 
PHP Code:
SELECT * FROM downloads WHERE filename LIKE '%blah.exe%' ORDER BY downloads DESC
this will get all downloads that have the word blah.exe in it. Hobo's will return 1 row that will equal the word blah.
-
Mar 18th, 2003, 07:24 PM
#4
Thread Starter
Lively Member
"It's difficult to imagine a world in which people voluntarily choose to listen to liberals. There is no evidence that it has ever happened. " - Ann Coulter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|