When retrieving data from a table, I assign it to an array of values of the form $ page_vars ['column_name_in_BD']:
... $result = $stmt->fetch( PDO::FETCH_ASSOC ); $stmt->closeCursor(); if( $stmt->rowCount() ) { foreach( $result as $key => $value) { $page_vars[$key] = $value[$key]; } } else { return 404; } I noticed that it occurs when an empty record is in the database (the 'author' field is of type varchar (255), since this table contains all the pages of the site, for some pages there is no author). It seems to work on the site does not affect, but from the principle I want to remove this warning! Well now, actually, the question is: how to get rid of this warning more elegantly, preferably without crutches of the type for each page without an author, to introduce a default like no_author? Well, error_reporting () does not offer :)