Sorry... I thought I had posted the issues, that must have been a support 
ticket somewhere instead.  heh

I have a main customer table with a handful of other tables that I join with it 
via PHP pages.  I've written a phone order system that works fine 98% of the 
time.  Every once in a while, the wrong customerid will get joined to these 
other tables.  I have the same join/query throughout the pages in the order 
process, but randomly the wrong customerid is either selected or joined with 
the wrong id in the joined table.  Kind of confusing...

So, if I have this (greatly simplified):

customer table:  
ID = 123, Name = John Doe
ID = 124, Name = Henry Harrison

customer notes:  
noteID = 14, customerID = 123
noteID = 15, customerID = 124

query:  SELECT tblCustomer.*, tblNotes.note FROM tblCustomer LEFT JOIN tblNotes 
ON tblCustomer.customerid = tblNotes.noteID 
WHERE tblCustomer.customerid = 123

The JOIN should always connect John with his notes and Henry with his notes, 
but every so often a hiccup occurs and the join returns Henry's notes with John 
instead of John's notes.  I've been trying to figure out what could cause the 
hiccup.  The query doesn't change.  The data doesn't change other than adding 
more notes or changing John's phone number.  The Notes table does contain a 
field with encrypted data which is the only lead I have at the moment.  I've 
been running the queries suggested from the other email to find corruption, but 
the tables check out fine.

Jenifer






  ----- Original Message ----- 
  From: [EMAIL PROTECTED] 
  To: Subscriptions 
  Cc: mysql@lists.mysql.com 
  Sent: Sunday, December 11, 2005 11:15 PM
  Subject: Re: Joins on tables with funky data?




  "Subscriptions" <[EMAIL PROTECTED]> wrote on 12/11/2005 10:46:08 PM:

  > Okay, so I haven't been able to find any corrupted tables.  Has 
  > anyone ever run into problems with joins between tables that contain
  > funky data?  I have a table that contains encrypted info and some of
  > the characters being used/stored are definitely odd.
  > 
  > I'm still trying to find the answer to our issues.  sigh.
  > 
  > Jenifer

  The olde saying goeth: Garbage in, garbage out.   

  If your data is bad, your results will be bad. However, I have heard nothing 
about problems during JOIN comparisons against BINARY data. Perhaps if you told 
us what weird things have been happening, we might be able to explain it. So 
far all you have done is to ask us how to tell if a table is corrupt and if 
JOINs work with BINARY data. Not much information for us to use to help you 
form a diagnosis, is it. 

  Shawn Green
  Database Administrator
  Unimin Corporation - Spruce Pine

Reply via email to