Jump to content

logic for getting results from 2 diffferent tables


Go to solution Solved by 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

Edited by dodgeitorelse3

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.