Welcome Guest, Not a member yet? Register   Sign In
Issue whit whitespace - easy!
#1

[eluser]tnathos[/eluser]
Hi all,

I have the next issue... pls help is easy Smile

i have in one controller and model a function for insert records in the database,m all works fine!!! but the problem is when i insert two words separate whit "whitespace" CI replace the whitespace whit ...

example... Hello word -> in the DB = Hello word

so... what i need setup in CI for not replace the whitespace Sad

TY!
#2

[eluser]tnathos[/eluser]
any please!! Sad
#3

[eluser]CroNiX[/eluser]
Are you sure CI is doing that IN the database, or is it just that's what it looks like when you output it in HTML? In HTML, a series of more than 1 spaces gets truncated to a single space unless you use the HTML entity for a space when you output it. This is basic HTML and doesn't have anything to do with PHP or CI.

Code:
"    hello"
will print as
Code:
" hello"
with a single space in HTML. If you want more spaces you have to use the HTML entity for a space.

You can try this with pure HTML and see.
Code:
<span>      a span    with     multiple spaces</span>
#4

[eluser]Bhashkar Yadav[/eluser]
are you using any validation rule which doing this wrongly?
#5

[eluser]tnathos[/eluser]
not i dont modify any rule in the CI or HTML.. the weird is the issue happen when the record is insert in the database... i make the calls using rest service, is posible for that?




Theme © iAndrew 2016 - Forum software by © MyBB