user956412
user956412

Reputation: 1

how i can solve this error "A PHP Error was encountered"?

Please give some idea. how to solve the error?

        echo "<td class='bold'>Race Category<span class='star'>*</span></td>";
    $array_all=array('name'=>'race_category','value'=>$s_race_category,'type'=>'RACE_CATEGORY','style'=>"class='selectbox'",'javascript'=>'','default'=>'');
    echo "<td>";
    echo $this->model_students->getAll($array_all);
    echo "</td>";

The error:

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: s_race_category
Filename: templates/forms.php
Line Number: 46

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: s_programme
Filename: templates/forms.php
Line Number: 124

Upvotes: -3

Views: 29507

Answers (1)

Geoffrey De Vylder
Geoffrey De Vylder

Reputation: 4153

The severity says "Notice", meaning they won't break your page but they indicate something else. In this case you probably haven't defined your variables before you use them.

try assigning a value to the variables like:

$s_race_category = "";
$s_programme = "";

You are seeing these notices because of the PHP error reporting level, you can read more about it here

Upvotes: 0

Related Questions