views:

44

answers:

1

When I use this statement if(count($this->input->post('p_id') =0)), I keep getting this error:

    Fatal error: Can't use method return value in write context in 
C:\xampp\htdocs\CI\professional_ci\application\models\MProducts.php  on line 249

But when I use if(count($this->input->post('p_id'))), it works. What does it mean I can't use method return?

+2  A: 

In the first line you're trying to assign the value 0 to the function count. What you should use is == to test for equality.

if(count($this->input->post('p_id'))==0)
Ira Rainey
Aye. The root cause of this error pops up in most languages for most programmers at one point or another. Some IDEs will even try and point this out to you.
Raven Dreamer
did the trick. thanks
ggfan