Welcome Guest, Not a member yet? Register   Sign In
Is the default value of $this->input->post() zero?
#1

[eluser]luffy[/eluser]
Hi,

The form value $this->input->post('title') is empty

But when I insert into the table, the value is 0?

Why?
#2

[eluser]imn.codeartist[/eluser]
[quote author="luffy" date="1262553024"]Hi,

The form value $this->input->post('title') is empty

But when I insert into the table, the value is 0?

Why?[/quote]

Check in your table whether you forgot to define your data type... whether its int in your table structure except varchar or text ??
#3

[eluser]luffy[/eluser]
The data type is varchar.
#4

[eluser]Tom Schlick[/eluser]
Im pretty sure that it returns FALSE if that post element doesn't exist. Which would display as 0.
#5

[eluser]Colin Williams[/eluser]
Correct. It is boolean FALSE, but when cast to a string, it is 0
#6

[eluser]luffy[/eluser]
Yeah, I know now. Thanks Smile




Theme © iAndrew 2016 - Forum software by © MyBB