I'm a newbie trying to write a short PHP script within PostNuke to enter data into a MySQL database.
If I enter something like "Please pay $20 now" into a simple text field, the dollar sign and the figure are missed out - this means that only "Please pay now" is saved.
This is an example of the output:
1.2 dollars = .2
1.20000 dollars = .20000
1.22222 dollars = .22222
12.33333 dollars = .33333
123.44444 dollars = 3.44444
1234.55555 dollars = 34.55555
12345.66666 dollars = 345.66666
(of course, no $ sign - or the first two numbers - are saved in the MySQL database).
Could one of you tell me what a possible solution could be. Ie. is this an escape character in PHP or MySQL? and if so, do you have a possible solution?
Please forgive my dumness, this may be painfully obvious to some of you.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mazdev responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 05:25 PM
- nestormateo responded to »Fillters in Clip« 06:33 AM
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 03:19 AM
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
- mesteele101 responded to »Problem in Database Connection« 21. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
$ sign problem - please advise.
-
- Rank: Team Member
- Registered: Jan 02, 2003
- Last visit: Oct 21, 2009
- Posts: 800
If you use double quotes PHP interprets the $20 as an variable and replaces it with its content - which is empty in your case.
Use single quotes instead. So the $20 remains as is.
Frank
--
"He is not dangerous, he just wants to play...."
- Moderated by:
- Support
