Jump to content

[SOLVED] SQL Query


RAH

Recommended Posts

Hi,

 

I have the following SQL query:

 

SELECT * FROM file_items ORDER BY view DESC LIMIT 0, 1

 

This lists the top viewed file in the database.  However there's a problem with this.

 

I need to ensure that file is of a certain type.  In a seperate table named "files" there is a column named "type".  The above query needs to be modified so that these two tables are cross-referenced.  Both tables have a column named "id" which could be used to match things up.

 

I'm not quite sure how to go about this - all help would be greatly appreciated.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/65749-solved-sql-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.