mike12255 Posted February 17, 2009 Share Posted February 17, 2009 Im trying to place text under a topic title, just part of the post as a short desciprtion with the following code: $getthreads="SELECT * from forumtutorial_posts where parentid='0' AND `area`= 'math' order by lastrepliedto DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); $name = strip_tags($getthreads3[post]); if (strlen($name) > 20){ while (strlen($name) >6){ $name = substr($name,0,-1); } } print "<tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</a></td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td> <b>$getthreads3[lastposter]</b></tr></br> $name </td>"; } print "</table>"; ?> Problem is i keep playing with this code and they text either ends up at the top of above all the topic titles, or they appear under the right topic title but are alinged right and i cant seem to fix it. Any suggestions?? Link to comment https://forums.phpfreaks.com/topic/145508-text-wont-go-were-i-want-it/ Share on other sites More sharing options...
alphanumetrix Posted February 17, 2009 Share Posted February 17, 2009 try this: $getthreads="SELECT * from forumtutorial_posts where parentid='0' AND `area`= 'math' order by lastrepliedto DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); $name = strip_tags($getthreads3[post]); if (strlen($name) > 20){ while (strlen($name) >6){ $name = substr($name,0,-1); } } print "<div style="position:static; float:bottom;" <tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</a></td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td> <b>$getthreads3[lastposter]</b></tr></br> $name </td>"; } print "</table></div>"; ?> Link to comment https://forums.phpfreaks.com/topic/145508-text-wont-go-were-i-want-it/#findComment-763958 Share on other sites More sharing options...
mike12255 Posted February 17, 2009 Author Share Posted February 17, 2009 I tried it and got this: Parse error: syntax error, unexpected T_STRING in /home/schoolw1/public_html/math.php on line 162 thats the line thats printing the div tag. Link to comment https://forums.phpfreaks.com/topic/145508-text-wont-go-were-i-want-it/#findComment-763961 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.