Welcome to WebmasterWorld Guest from 107.20.5.156

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

wordpress echo dollar sign from db

echo dollar sign from db

     

weddingm

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

5+ Year Member



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?

Readie

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

WebmasterWorld Senior Member 5+ Year Member



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.