AllExperts > MySQL 
Search      
MySQL
Volunteer
Answers to thousands of questions
 Home · More MySQL Questions · Answer Library  · Encyclopedia ·
More MySQL Answers
Question Library

Ask a question about MySQL
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About stuart gregory
Expertise
PHP html, xhtm, css coding and MySQL

Experience
My experiance is all first had as i am web developer and i have and do build many websites all using php and mysql. This ranges from building a search engine to secure php login scripts. some websites like http://www.mylifelink.co.uk are complete database driven websites.

Organizations
I have a large number of websites which i host and maintain, such as. http://www.webreger.com http://www.mylifelink.co.uk http://www.lush-lingerie.com http://www.scotchpiper.co.uk http://www.mysafesearch.co.uk http://www.lush-lingerie.com

Education/Credentials
Web application development. (Open University) BSC Honers Computing and development (Open University)

 
   

You are here:  Experts > Computing/Technology > Databases > MySQL > Cross checking Databases in mySQL

MySQL - Cross checking Databases in mySQL


Expert: stuart gregory - 9/28/2009

Question
Hi,

I'll preface this by saying that I haven't with a command line in any way shape or form in years, so please feel free to spell everything out for me.  Please!  

With that out of the way, I have to cross-check data in mysql tables.  One column is last month's entries, and the second is this month's entries and I'm simply looking for repeat entries to be exported to a new database.

So. . . how do is this done?

Answer
Dear Sir

I'm not fully sure what you mean here but heres what i think you mean, please correct me if i am wrong.

You want a script to check last months entries, agaist this months entries if there is a match move to new database table

or do you mean if there is more than one entry the same in either last month or this month move to new database table so last month and this month only have unique entries in them?

either on of these situations could be written witha simple PHP script, A while loop selects each entry in the table then for each entry find the number of rows that match a key term, then if MySQL number of rows = > 1 you then need a script to move the table contents to another table,

Now continue with the loop for the next entry.

Before writting such a script it is advisable to write a simple structured english statment of what the script should do and they work through it step by step. once each step works continue to the next step rather than trying to write the script all in one go.

Try using http://www.web-application-development.info as a refrence point for scripts plus they have a new forum there dedicated for script help

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.