ethicaldesign
February 21st, 2005, 17:19
Has anyone ever experienced anything like this before.
I've spent a good chunk of the day trying to work out why a relatively complex MySQL multiple join query isn't working. At first I thought it was me but in the process of trying to track down the problem, I've come across:
select * from cds_Lnk WHERE ProdID='S0014935';
+----------+----------------+
| ProdID | RelatedProduct |
+----------+----------------+
|935 | S0326379
|935 | S0665343
+----------+----------------+
Obviously the ProdID should display as S0014935 in the ProdID column. For some reason it's cropping off everything but the last 3 characters.
This is a straightforward varchar column. I've tried dropping this table, recreating and repopulating with records and still the same problem.
I get the feeling that the reason my more complex Join queries weren't working is because they're joined on this ProdID which is being listed incorrectly.
Oddly, if you select only the ProdID it displays properly.
These results are being displayed when querying through the mysql command prompt in a ssh session (I use mysql directly like this when working out some of my queries to check results before coding in php as it's usually quicker this way).
Anyone got any ideas?
I've spent a good chunk of the day trying to work out why a relatively complex MySQL multiple join query isn't working. At first I thought it was me but in the process of trying to track down the problem, I've come across:
select * from cds_Lnk WHERE ProdID='S0014935';
+----------+----------------+
| ProdID | RelatedProduct |
+----------+----------------+
|935 | S0326379
|935 | S0665343
+----------+----------------+
Obviously the ProdID should display as S0014935 in the ProdID column. For some reason it's cropping off everything but the last 3 characters.
This is a straightforward varchar column. I've tried dropping this table, recreating and repopulating with records and still the same problem.
I get the feeling that the reason my more complex Join queries weren't working is because they're joined on this ProdID which is being listed incorrectly.
Oddly, if you select only the ProdID it displays properly.
These results are being displayed when querying through the mysql command prompt in a ssh session (I use mysql directly like this when working out some of my queries to check results before coding in php as it's usually quicker this way).
Anyone got any ideas?