getErrors returning blank (white) page

Hello,

This is my table’s structure :


mysql> EXPLAIN uye;

+-------+------------------+------+-----+---------+----------------+

| Field | Type             | Null | Key | Default | Extra          |

+-------+------------------+------+-----+---------+----------------+

| ID    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |

| FbID  | int(10) unsigned | NO   |     | NULL    |                |

| Ko    | varchar(51)      | NO   |     | NULL    |                |

+-------+------------------+------+-----+---------+----------------+



As you can see, Ko collumn can’t be NULL. But if we use this :


$uye = new Uye;

$uye->FbID = $katilimci->FbID; // $katilimci->FbID is an integer

$uye->save();

getErrors() must return an error but when i use it like this :


                if($uye->save())

                {

                }

                else

                {

                    print_r(getErrors());

                }

It’s producing completely blank (white) page. If i use like this:


                if($uye->save())

                {

                }

                else

                {

                    echo "ERROR";

                }

it’s printing ERROR.

I think there is a syntax error. I’m not sure.

You need to use $model->getErrors()

This time i’m getting this error :


Fatal error: Call to a member function getErrors() on a non-object in /home/bak1skea/public_html/protected/controllers/KuyrukController.php on line 146

$model is in your case $uye.

/Tommy