dodgeitorelse3 Posted July 22, 2013 Share Posted July 22, 2013 (edited) 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 July 22, 2013 by dodgeitorelse3 Quote Link to comment https://forums.phpfreaks.com/topic/280394-logic-for-getting-results-from-2-diffferent-tables/ Share on other sites More sharing options...
dodgeitorelse3 Posted July 22, 2013 Author Share Posted July 22, 2013 forgot to add the following countersTable comments: VIEWField Type Null Default Commentsfilename varchar(255) No stats int(11) No maps_viewTable comments: VIEWField Type Null Default Commentsid 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. Quote Link to comment https://forums.phpfreaks.com/topic/280394-logic-for-getting-results-from-2-diffferent-tables/#findComment-1441710 Share on other sites More sharing options...
Solution dodgeitorelse3 Posted July 22, 2013 Author Solution Share Posted July 22, 2013 as well as the version which is mysql 5.0.7 Quote Link to comment https://forums.phpfreaks.com/topic/280394-logic-for-getting-results-from-2-diffferent-tables/#findComment-1441713 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.