Fix Notice-Level messages #10

Closed
opened 2016-05-23 14:31:23 +02:00 by fsedarkalex · 10 comments
fsedarkalex commented 2016-05-23 14:31:23 +02:00 (Migrated from git.firesplash-entertainment.com)

Please mention this issue in your merge request when submitting. Thanks.

Please mention this issue in your merge request when submitting. Thanks.
fsedarkalex commented 2016-05-23 14:31:43 +02:00 (Migrated from git.firesplash-entertainment.com)

Changed title: Fix{-e-} Notice-Level messages → Fix Notice-Level messages

By Alexander Täffner on 2016-05-23T12:31:43 (imported from GitLab project)

Changed title: **Fix{-e-} Notice-Level messages** → **Fix Notice-Level messages** *By Alexander Täffner on 2016-05-23T12:31:43 (imported from GitLab project)*
fsedarkalex commented 2016-05-23 17:56:55 +02:00 (Migrated from git.firesplash-entertainment.com)

Added ~30 label

By Alexander Täffner on 2016-05-23T15:56:55 (imported from GitLab project)

Added ~30 label *By Alexander Täffner on 2016-05-23T15:56:55 (imported from GitLab project)*
fsedarkalex commented 2016-05-27 13:36:04 +02:00 (Migrated from git.firesplash-entertainment.com)

If you execute a select command that returns empty data (e.g. in case when a table is empty), you get a PHP notice level warning in Apache error.log file. It may look like this:
PHP Notice: Undefined offset: 0 in /var/www/html/EasyMySQLi.inc.php on line 498.
This warning is produced by the querySingleField function. The same warning also occurs in the querySingleRow function.

By Ramil Valitov on 2016-05-27T11:36:04 (imported from GitLab project)

If you execute a **select** command that returns empty data (e.g. in case when a table is empty), you get a PHP notice level warning in Apache error.log file. It may look like this: `` PHP Notice: Undefined offset: 0 in /var/www/html/EasyMySQLi.inc.php on line 498. `` This warning is produced by the **querySingleField** function. The same warning also occurs in the **querySingleRow** function. *By Ramil Valitov on 2016-05-27T11:36:04 (imported from GitLab project)*
fsedarkalex commented 2016-05-27 13:39:40 +02:00 (Migrated from git.firesplash-entertainment.com)

I see and yes that sounds legit.
In my opinion any of our query-Methods should return null in case of zero lines or an empty array.
Empty array is more comfortable but other way null is more strict.

My Vote goes to null

//Edit: Of course is array only valid for querySingleRow and queryAllRows - for SingleFiled it would always be null. thus we should use null for any query

//Edit 2 - Today is the day of Aunt Edit(h): Further this even makes the issue a bug.

By Alexander Täffner on 2016-05-27T11:41:40 (imported from GitLab project)

I see and yes that sounds legit. In my opinion any of our query-Methods should return null in case of zero lines or an empty array. Empty array is more comfortable but other way null is more strict. My Vote goes to null //Edit: Of course is array only valid for querySingleRow and queryAllRows - for SingleFiled it would always be null. thus we should use null for any query //Edit 2 - Today is the day of Aunt Edit(h): Further this even makes the issue a bug. *By Alexander Täffner on 2016-05-27T11:41:40 (imported from GitLab project)*
fsedarkalex commented 2016-05-27 13:41:50 +02:00 (Migrated from git.firesplash-entertainment.com)

Added ~23 ~25 labels

By Alexander Täffner on 2016-05-27T11:41:50 (imported from GitLab project)

Added ~23 ~25 labels *By Alexander Täffner on 2016-05-27T11:41:50 (imported from GitLab project)*
fsedarkalex commented 2016-05-27 13:42:33 +02:00 (Migrated from git.firesplash-entertainment.com)

mentioned in commit 20251e7942

By Ramil Valitov on 2016-05-27T11:42:33 (imported from GitLab project)

mentioned in commit 20251e7942446a32b4ccee00680b74f48620594a *By Ramil Valitov on 2016-05-27T11:42:33 (imported from GitLab project)*
fsedarkalex commented 2016-05-27 13:44:05 +02:00 (Migrated from git.firesplash-entertainment.com)

mentioned in merge request !20

By Ramil Valitov on 2016-05-27T11:44:05 (imported from GitLab project)

mentioned in merge request !20 *By Ramil Valitov on 2016-05-27T11:44:05 (imported from GitLab project)*
fsedarkalex commented 2016-05-27 13:51:23 +02:00 (Migrated from git.firesplash-entertainment.com)

Yes, null is the right choice. Actually, the return value has been automatically null for all functions: queryAllRows, querySingleRow, querySingleField. This fix just removes the PHP warning.

By Ramil Valitov on 2016-05-27T11:51:23 (imported from GitLab project)

Yes, null is the right choice. Actually, the return value has been automatically null for all functions: queryAllRows, querySingleRow, querySingleField. This fix just removes the PHP warning. *By Ramil Valitov on 2016-05-27T11:51:23 (imported from GitLab project)*
fsedarkalex commented 2016-05-27 15:44:23 +02:00 (Migrated from git.firesplash-entertainment.com)

Status changed to closed by commit 20251e7942

By Ramil Valitov on 2016-05-27T13:44:23 (imported from GitLab project)

Status changed to closed by commit 20251e7942446a32b4ccee00680b74f48620594a *By Ramil Valitov on 2016-05-27T13:44:23 (imported from GitLab project)*
fsedarkalex commented 2016-05-27 15:44:23 +02:00 (Migrated from git.firesplash-entertainment.com)

Status changed to closed by merge request !20

By Alexander Täffner on 2016-05-27T13:44:23 (imported from GitLab project)

Status changed to closed by merge request !20 *By Alexander Täffner on 2016-05-27T13:44:23 (imported from GitLab project)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OpenSource_Libraries/PHP-EasyMySQLi#10
No description provided.