0

this issue has been bugging me for a while. I've got a database in MySQL, managed by phpMyAdmin. We'll call this Database 1. It holds the records of research on music, sorted like this. Database 1 is outside-sourced.

[song title] [song artist] [how many times song was played, "spins."]

The text file, we'll call this Database 2, is sorted differently. It contains similar information. Song title, artist and its location within our system based on an inventory number. All of that information is on one line, no separation symbol of any kind. Just spacing. Example Line:

3793 THE BEETLES ELEANOR RIGBY

3793 is our inventory number, THE BEETLES is the artist, ELEANOR RIGBY is the song. That's exactly how it's laid out in the file - by the way, this file is 2400 songs long.

I'm trying to cross reference these. If a song exists in db1, and not in db2, it needs a flag. Same thing vice versa. I was trying to do this with a version of: PHP to search within txt file and echo the whole line

Db1 & db2 are in a file on my localhost xampp server.

Ryan Schaefer
  • 3,047
  • 1
  • 26
  • 46
  • 2
    There's no PHP or SQL code here, so this question is premature and off-topic until you've got something, anything we can review and fix. – tadman Mar 13 '18 at 22:40
  • Have a look at the [mySQL documentation](https://dev.mysql.com/doc/). I believe you'll find that you can do this with mySQL rather than having to involve PHP. If you find that you still need help, then first have a look at the [guidelines](https://stackoverflow.com/help) for posting questions. – SaganRitual Mar 13 '18 at 22:46
  • Totally off-topic, but it's "Beatles", isn't it? – Don't Panic Mar 13 '18 at 22:48
  • "THE BEETLES is the artist" - How do you know it's not "THE BEETLES ELEANOR"? – Paul Spiegel Mar 13 '18 at 22:59
  • You just can't know of how many word is composed the artist or the song name, and what about if a song title has a number in it? You need at least a separator for each entry. Then another one for each column. Or make a structure to save records as binary values with length preceding each string – GrowingBrick Mar 14 '18 at 13:20

0 Answers0