fireice87 Posted June 13, 2008 Share Posted June 13, 2008 hi im working on a site http://www.gigshare.net/UrbanGadgeteer/index.php?pageno=2 the data on the products is pulled from a database and printed out on this page. but it is proceded by mutiple < r> symbols. Iv been through my code that creates the table and //commented out sections to see if there was an odd typo but it is always happening. Is this error caused by an incorrect use of a function? there are less < r> symbols on a page with less products http://www.gigshare.net/UrbanGadgeteer/index.php?page=cat&sub=6 here is the code <?php $count =0; echo "<table>"; while ($count < $rows_per_page && $count < $num) { $row = mysql_fetch_array($result); $disc_display = substr($row['description'], 0, 80); echo "<tr>"; echo "<td width=\"170\" align=\"center\" rowspan=\"5\" height=\"135\"> <img src='Images/small_product_image/".$row['prod_id']."/0.jpg' alt=\"Image Unavailable\" /> </td>"; echo "<td align=\"left\" width=\"250\" valign\"top\" height=\"15\" class=\"product\">".$row['product']."</td>"; echo "<td align=\"left\" height=\"15\" class=\"moreinfo\"> Customer rating 4/5 </td>"; echo "<\tr>"; echo "<tr>"; echo "<td align=\"left\" height=\"15\" class=\"desc\">$disc_display </td>"; echo "<\tr>"; echo "<tr>"; echo "<\tr>"; echo "<tr>"; echo "<td align=\"left\" height=\"15\" valign\"top\" class=\"moreinfo\"> <a class=\"product\" href=\"index.php?page=prod&p=".$row['prod_id']."\">View product details</a> </td>"; echo "<td align=\"left\" height=\"15\" class=\"price\">Just £".$row['price']."</td>"; echo "<\tr>"; echo "<tr>"; echo "<td align=\"left\" height=\"15\" class=\"price\"></td>"; echo "<td align=\"left\" height=\"20\"><a href=\"basket.php?action=add&p=".$row['prod_id']."\"><img src=\"Images/addtobasket.gif\" alt=\"Add To Basket\" /></td>"; echo "<\tr>"; $count++; } echo "</table>"; Anyone seen this before, any ideas? Much appreciated, thanks Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted June 13, 2008 Share Posted June 13, 2008 When you use \t in a double quoted string PHP is adding in a tab. This is the problem line(s). echo "<\tr>"; Change your double quotes to single quotes. Or use echo "<\\tr>"; Quote Link to comment Share on other sites More sharing options...
fireice87 Posted June 13, 2008 Author Share Posted June 13, 2008 Thanks alot, the single quotes are working perfectly strange though i've always used "<\tr>" and this is the only time its caused an issue Thanks Again! 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.