Jump to content

logic for getting results from 2 diffferent tables


dodgeitorelse3

Recommended Posts

I have 2 separate tables both hosted in different database on same host.

 

The first table  is in "aa" database and is called "maps" and has "id" and "name" for columns (there are several more columns that I am not using for this situation nor are they named same as any columns in table 2). This table contains the name of our maps that are available for downloads (the dload links are in a column in this db named "content"). the map names in the "name" column are for example KitchenWar.

 

The second table is in "counts" database and is called "downloads" contains columns named "filename" and "stats" (these are the only 2 columns in this table). This database is for keeping count of the number of downloads from first table which is done via a file called downloads.php. The map names in the "filename" column are for example maps/KitchenWar.aao

 

What I have is a webpage that holds a table that contains all the data from table "maps" and the last row of the table has a column labeled dl's which I want to hold the "stats" from table named "maps" that matches the "name" from "maps" table.

 

My question is this ..... how do I go about trying to compare "name" column to "filename" column and then show the "stats" that match?

 

 

exaples of db tables ...

 

table "maps"

 

          id                                        name

---------------------------------------------------------

Auto increment                        KitchenWar

 

 

 

 

table "downloads"

 

       filename                                   stats

---------------------------------------------------------

maps/KitchenWar.aao                      64

forgot to add the following

 

counters
Table comments: VIEW

Field     Type     Null     Default     Comments
filename     varchar(255)     No            
stats     int(11)     No            





maps_view
Table comments: VIEW

Field     Type     Null     Default     Comments
id     int(100)     No      0      
name     varchar(200)     No            
 

 

as for things I have tried so far ..... none I am asking for guidance for where to start, not for someone to write the code for me.

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.