View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Error in headerFunctions.php : Parameter must be an array - ProjeQtOr

Prochaines sessions de formation

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)

Mardi 23 avril (10h30-12h)

Jeudi 16 mai (16h-17h30)

Jeudi 13 juin (10h30-12h)

 
 

Planifiez avec ProjeQtOr

3 et 4 avril (9h - 12h30)

 
 

Administrez avec ProjeQtOr

10 et 11 avril (9h - 12h30)

 

 

 
 

Error in headerFunctions.php : Parameter must be an array

More
19 Mar 2020 15:13 #1 by antoine1003
Hi,
I am trying to create a custom report but I got a error really strange.
Error :
2020-03-19 14:58:18.888 ***** ERROR ***** [V8.3.2] on file 'C:\wamp64\www\ipmp_new\report\headerFunctions.php' at line (54)
2020-03-19 14:58:18.893 ***** ERROR ***** [V8.3.2] cause = count(): Parameter must be an array or an object that implements Countable
Here is the code which produce the bug :
$queryWhere = ($queryWhere == '') ? ' 1=1' : $queryWhere;
$query = 'select ' . $querySelect
    . ' from ' . $queryFrom
    . ' where ' . $queryWhere;
$result = Sql::query($query);
if (checkNoData($result)) exit; // The error occurs in that function
The variable $query contains this query :
select `id`, DATE_FORMAT(`externalValidation`, '%Y%m%d') `delivered`, DATE_FORMAT(`externalValidationScheduled`, '%Y%m%d') `planned`, DATE_FORMAT(`externalValidation`, '%Y-%m') `interval` from `document` where `idProject` IN (0, 100) AND `externalValidationScheduled` IS NOT NULL AND `externalValidation` BETWEEN '2020-03-01' AND '2021-02-28' AND `idDocumentType` = '63'

When I run this query in PHP my admin it return 0 row but no error.

The begin of function checkNoData :
function checkNoData($result, $month=null) {
  global $outMode;
  if (count($result)==0) { // Error is thrown here

The $result parameter :


I don't understand why the Sql::query doesn't return proper value :'(

Please Connexion or Create an account to join the conversation.

More
19 Mar 2020 19:44 #2 by babynus
checkNoData() expects an array as parameter.
You send a resource to a query.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.032 seconds

Paramétrages de cookies

×

Cookies fonctionnels

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Veuillez vous connecter pour voir vos activités!

Autres cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.