This is a discussion on String length? within the MySQL forums, part of the Database Server Software category; --> I am collecting data from a database. This works fine, I can call the data from these tables and ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am collecting data from a database. This works fine, I can call the data from these tables and display it as I wish *************************** $ml_collect='SELECT * FROM ml_lopp LEFT JOIN scfmforening ON (scfmforening.scfmnum=ml_lopp.scfmnum) LEFT JOIN ml_newtidplats ON (ml_newtidplats.loppnum=ml_lopp.loppnum) WHERE ml_lopp.sank2006="ja" ORDER BY date1, ml_lopp.loppnum'; $ml_upg=mysql_query($ml_collect); $num_ml=mysql_numrows($ml_upg); mysql_close(); *************************** Now I want to add in a few more tables so I simply expanded the strong associated to $ms_collect to ********************* $ml_collect='SELECT * FROM ml_lopp LEFT JOIN scfmforening ON scfmforening.scfmnum=ml_lopp.scfmnum) LEFT JOIN ml_newtidplats ON ml_newtidplats.loppnum=ml_lopp.loppnum) LEFT JOIN ml_mainkon ON ml_mainkon.loppnum=ml_lopp.loppnum) LEFT JOIN ml_anm ON ml_anm.loppnum=ml_lopp.loppnum) LEFT JOIN ml_avg ON (ml_avg.loppnum=ml_lopp.loppnum LEFT JOIN ml_dist ON (ml_dist.loppnum=ml_lopp.loppnum) LEFT JOIN ml_eft ON ml_eft.loppnum=ml_lopp.loppnum) LEFT JOIN ml_upply ON ml_upply.loppnum=ml_lopp.loppnum) LEFT JOIN ml_konpers ON ml_konpers.loppnum=ml_lopp.loppnum) LEFT JOIN ml_konsem ON ml_konsem.loppnum=ml_lopp.loppnum) WHERE ml_lopp.sank2006="ja" ORDER BY date1, ml_lopp.loppnum'; $ml_upg=mysql_query($ml_collect); $num_ml=mysql_numrows($ml_upg); mysql_close(); ********************* But this does not work and it returns no data. It seems to crash when the string I associate goes over 256 characters. Or maybe its the number of left joins I am using? Is there another way to associate the string I want. Whats the best way to fix this? Garry Jones Sweden |
| |||
| GarryJones wrote: > I am collecting data from a database. > > This works fine, I can call the data from these tables and display it > as I wish > > *************************** > $ml_collect='SELECT * FROM ml_lopp LEFT JOIN scfmforening ON > (scfmforening.scfmnum=ml_lopp.scfmnum) LEFT JOIN ml_newtidplats ON > (ml_newtidplats.loppnum=ml_lopp.loppnum) WHERE ml_lopp.sank2006="ja" > ORDER BY date1, ml_lopp.loppnum'; > > $ml_upg=mysql_query($ml_collect); > $num_ml=mysql_numrows($ml_upg); > mysql_close(); > *************************** > Now I want to add in a few more tables so I simply expanded the strong > associated to > > $ms_collect to > ********************* > $ml_collect='SELECT * FROM ml_lopp LEFT JOIN scfmforening ON > scfmforening.scfmnum=ml_lopp.scfmnum) LEFT JOIN ml_newtidplats ON > ml_newtidplats.loppnum=ml_lopp.loppnum) LEFT JOIN ml_mainkon ON > ml_mainkon.loppnum=ml_lopp.loppnum) LEFT JOIN ml_anm ON > ml_anm.loppnum=ml_lopp.loppnum) LEFT JOIN ml_avg ON > (ml_avg.loppnum=ml_lopp.loppnum LEFT JOIN ml_dist ON > (ml_dist.loppnum=ml_lopp.loppnum) LEFT JOIN ml_eft ON > ml_eft.loppnum=ml_lopp.loppnum) LEFT JOIN ml_upply ON > ml_upply.loppnum=ml_lopp.loppnum) LEFT JOIN ml_konpers ON > ml_konpers.loppnum=ml_lopp.loppnum) LEFT JOIN ml_konsem ON > ml_konsem.loppnum=ml_lopp.loppnum) WHERE ml_lopp.sank2006="ja" ORDER > BY date1, ml_lopp.loppnum'; > > $ml_upg=mysql_query($ml_collect); > $num_ml=mysql_numrows($ml_upg); > mysql_close(); > ********************* > But this does not work and it returns no data. It seems to crash when > the string I associate goes over 256 characters. Or maybe its the > number of left joins I am using? Is there another way to associate the > string I want. > > Whats the best way to fix this? > > Garry Jones > Sweden You seem to have some mismatched brackets. |
| ||||
| > You seem to have some mismatched brackets.- Dölj citerad text - $ml_collect='SELECT * FROM ml_lopp LEFT JOIN scfmforening ON (scfmforening.scfmnum=ml_lopp.scfmnum) LEFT JOIN ml_newtidplats ON (ml_newtidplats.loppnum=ml_lopp.loppnum) LEFT JOIN ml_mainkon ON (ml_mainkon.loppnum=ml_lopp.loppnum) LEFT JOIN ml_anm ON (ml_anm.loppnum=ml_lopp.loppnum) LEFT JOIN ml_avg ON (ml_avg.loppnum=ml_lopp.loppnum) LEFT JOIN ml_dist ON (ml_dist.loppnum=ml_lopp.loppnum) LEFT JOIN ml_eft ON (ml_eft.loppnum=ml_lopp.loppnum) LEFT JOIN ml_upply ON (ml_upply.loppnum=ml_lopp.loppnum) LEFT JOIN ml_konpers ON (ml_konpers.loppnum=ml_lopp.loppnum) LEFT JOIN ml_konsem ON (ml_konsem.loppnum=ml_lopp.loppnum) WHERE ml_lopp.sank2006="ja" ORDER BY date1, ml_lopp.loppnum'; That was only when I copy and pasted and tidied to posted here, but even with correct brackets it works until I put the string over four "Left Joins" or 256 characters. Any ideas? Garry Jones Sweden |