popcop Posted July 31, 2011 Share Posted July 31, 2011 im havin a problem with displaying some text with data from the database the text on my page should display like this example : John Smith thinks that this will happen on Wednesday 14th August 2011 this is the code i have echo "<tr class='$class'>"; echo "<td>" . $row['firstname'] . . $row['firstname'] . "thinks that this will happen on " . $row['date'] . "</td>"; echo "</tr>"; hope you can help Quote Link to comment https://forums.phpfreaks.com/topic/243414-displaying-text-with-varibles/ Share on other sites More sharing options...
cunoodle2 Posted July 31, 2011 Share Posted July 31, 2011 What error messages, if any are you getting? Here is how You could try formatting the code if you like.. echo '<tr class="$class">'; echo "<td>".$row["firstname"]." ".$row["firstname"]." thinks that this will happen on ".$row["date"]."</td>"; echo "</tr>"; Does that work? Quote Link to comment https://forums.phpfreaks.com/topic/243414-displaying-text-with-varibles/#findComment-1249961 Share on other sites More sharing options...
popcop Posted July 31, 2011 Author Share Posted July 31, 2011 thats seems to have worked how would i give a class to the date varible so that i can stlye it differently?? Quote Link to comment https://forums.phpfreaks.com/topic/243414-displaying-text-with-varibles/#findComment-1249984 Share on other sites More sharing options...
AyKay47 Posted August 1, 2011 Share Posted August 1, 2011 you can either style the <td> that it's inside of, or if you want it to have a unique style, you can wrap it inside of a <span> tag and customize the <span> css Quote Link to comment https://forums.phpfreaks.com/topic/243414-displaying-text-with-varibles/#findComment-1249995 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.