imimin Posted June 26, 2009 Share Posted June 26, 2009 I am having problems with some code. I am echoing the following: <HR width=80%> ".substr($item_desc,0,85)."... When I use VARCHAR as the data type, it works well with short text. If I place a large amount of text in using TEXT as the data type and have a table in with the text, it breaks the iteration it is in. Can someone tell me what is going on? Quote Link to comment Share on other sites More sharing options...
imimin Posted June 27, 2009 Author Share Posted June 27, 2009 Everything seems to work fine with other HTML tags (like <B>, <BR>, etc) but for some reason it does not like my <TABLE> tag??? It breaks the echo output at the point of the table and prints the table inside my page that should only be displaying thumbnail images and a truncated description. The code is as such: echo "<TD class=\"preview-images\" VALIGN=\"top\" WIDTH=\"25%\"> <CENTER><A HREF=\"$sitelocation" . "$item_url" . "?" . "item_desc=" . "$item_desc" . "&" ."item_prod_name=" . "$item_prod_name" . "&" ."item_available_colors=" . "$item_available_colors". "&" ."item_available_sizes=" . "$item_available_sizes". "&" ."item_retail=" . "$item_retail". "&" ."item_prod_code=" . "$item_prod_code". "&" . "item_img=" . "$item_img" . "&" ."item_selected_style=" . "$item_selected_style". "&" ."item_selected_color=" . "$item_selected_color". "&" . "item_selected_size=" . "$item_selected_size" . "&" . "item_weight=" . "$item_weight\"> <IMG SRC=\"includes/img_resize3.php?src=$sitelocation$item_img&width=144&height=144&qua=50\" BORDER=\"0\"></A> <center><b>$item_prod_name</b></center> <HR width=80%> ".substr($item_desc,0,85)."... <BR><BR> The data (TEXT data type)that seems to be causing the the problem is: Little Big Pants (drawstring waist) unisex sizes range teen-adult Causal fun style beach towel comfort pant for coming and going from the beach resort or pool, perfect for kicking back around the house. KIDS LOVE THEM! Mid calf length, sizes are generous:<BR><BR> <div align="left"> <table border="1" width="100%" cellpadding="1" cellspacing="1"> <tr> <td align="left">Size</td> <td align="left">Small</td> <td align="left">Medium</td> <td align="left">Large</td> <td align="left">Extra Large</td> </tr> <tr> <td align="left">Waist</td> <td align="left">26-28</td> <td align="left">30-32</td> <td align="left">34-36</td> <td align="left">36-46</td> </tr> <tr> <td align="left">Inseam</td> <td align="left">17</td> <td align="left">18</td> <td align="left">19</td> <td align="left">20</td> </tr> </table> </div> Any ideas? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted June 27, 2009 Share Posted June 27, 2009 Is it because you're limiting the amount it can display with substr()? Try removing the substr() function from around the variable, see if it will display properly then. Quote Link to comment Share on other sites More sharing options...
imimin Posted June 27, 2009 Author Share Posted June 27, 2009 I need the substr() to truncate my desc data on this thumbnail page. The next page will show all the desc TEXT. The substr() works fine for the data if I do not use the <table> tag. Would it help if I sent you the web page links so you can see what is going on? Quote Link to comment Share on other sites More sharing options...
imimin Posted June 29, 2009 Author Share Posted June 29, 2009 Does anybody have any ideas on how I can get this to work? I am really in a tight spot with this! Thank you so much for your help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.