Welcome to WebmasterWorld Guest from 54.234.244.30

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

wordpress echo dollar sign from db

echo dollar sign from db

     
2:46 am on Oct 22, 2013 (gmt 0)

Junior Member

5+ Year Member

joined:Mar 9, 2006
posts: 177
votes: 0


Hello,

I am trying to echo $1299 from a database onto a wordpress page. However all I get is 99. I even used single quotes.


echo'.$phone.'
<a href="http://'.$website.'" rel="nofollow">'.$website.'</a>
'.$communication.'';


In the field communication, it echoes 99 for what is in the database as $1299.

Any ideas?
5:47 pm on Oct 22, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Dec 13, 2009
posts:943
votes: 0


Humm. As far as I'm aware, and indeed in a quick test I just threw together, a dollar in a variable has no bearing on echo.

It's also definitely nothing such as a numeric typecasting, as they use "from-the-first" characters - in this case a $, which results in it being cast to 0.

I'm going to suggest that either:
- You are mistaken about what record is actually being pulled from the database
- You are re-using a variable already set to "99" - and have a spelling error in the second assignment
- You have some debug code that is overwriting your database value within the PHP

tl;dr: there's nothing really wrong with the code sample provided - the problem lies higher up in the script.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members