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. Link to comment https://forums.phpfreaks.com/topic/205383-echo-to-mysql-field/ Share on other sites More sharing options...
Alex Posted June 21, 2010 Share Posted June 21, 2010 <?php echo "$" . $f3; ?> Link to comment https://forums.phpfreaks.com/topic/205383-echo-to-mysql-field/#findComment-1074840 Share on other sites More sharing options...
inversesoft123 Posted June 21, 2010 Share Posted June 21, 2010 or echo "$ $f3"; Link to comment https://forums.phpfreaks.com/topic/205383-echo-to-mysql-field/#findComment-1074843 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. Link to comment https://forums.phpfreaks.com/topic/205383-echo-to-mysql-field/#findComment-1074844 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.