homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

wordpress echo dollar sign from db
echo dollar sign from db

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


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

<a href="http://'.$website.'" rel="nofollow">'.$website.'</a>

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)

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved