Quote:
Originally Posted by kh99
errors isn't a function, so you can't put the parens after it. Also, the vb code uses empty() instead of !isset() (but I can't remember offhand what the difference is if any - probably either will work). Oh, and in the vb code it looks like they call pre_save() before checking the errors.
Anyway, in the vb code they use:
Code:
$pmdm->pre_save();
if (empty($pmdm->errors))
{
$pmdm->save();
}
|
The reason the code uses empty instead of isset is that isset just checks if the variable exists the other is used to see if an array has any values in it. An empty array (i.e. with no errors) will return true for empty but false for !isset.