Bluehost.com Web Hosting $6.95

String length?

This is a discussion on String length? within the MySQL Database forums, part of the Database Forums category; I am collecting data from a database. This works fine, I can call the data from these tables and display ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-07-2007
GarryJones
 
Posts: n/a
Default String length?

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

Reply With Quote
  #2 (permalink)  
Old 02-07-2007
Paul Lautman
 
Posts: n/a
Default Re: String length?

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.


Reply With Quote
  #3 (permalink)  
Old 02-07-2007
GarryJones
 
Posts: n/a
Default Re: String length?

> 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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 04:17 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0