ntroycondo Posted June 21, 2010 Share Posted June 21, 2010 Tried a few variations but not getting the correct syntax. I'm using while loop to echo out fields from mysql DB with: <td><?php echo $f3; ?></td> I want the above column to include $ sign since it is a cost field. \$ is used for adding a dollar sign with echo? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Alex Posted June 21, 2010 Share Posted June 21, 2010 <?php echo "$" . $f3; ?> Quote Link to comment Share on other sites More sharing options...
inversesoft123 Posted June 21, 2010 Share Posted June 21, 2010 or echo "$ $f3"; Quote Link to comment Share on other sites More sharing options...
ntroycondo Posted June 21, 2010 Author Share Posted June 21, 2010 "$" . works great. Thanks. "$ $f3"; prints out the $ but not the table variable taking out the first ; breaks it all. 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.