You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2006-01-06 15:55:44

mbergevoet
Member
Registered: 2006-01-06
Posts: 12

Mysql error in software/classes

Hello All,

When i go to Software and select a software packages it displays the page but with errors for the license part:


Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\OCSinventoryNG\xampp\htdocs\ocsreports\glpi\glpi\common\classes.php on line 90

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\OCSinventoryNG\xampp\htdocs\ocsreports\glpi\glpi\common\classes.php on line 93


I use the following software versions:

GLPI version 0.6
Ver. 4010   
Xampp

I hope that someone has a clue?

Thanks

Offline

#2 2006-01-06 16:00:55

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Mysql error in software/classes


Xavier Caillaud
Blog GLPI Infotel

Offline

#3 2006-01-06 16:10:14

mbergevoet
Member
Registered: 2006-01-06
Posts: 12

Re: Mysql error in software/classes

Thank you for the quick response but i don't understand french
Could you help me understand what they say in that posting?
Great that French people have developed GLPI and OCS but for non-french people it'srealy difficult to understand the Forum and CVS entrys sad

Hope you can translate a bit for me

thanks

Offline

#4 2006-01-06 16:19:12

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Mysql error in software/classes

Do you use ocs version 4010 ? with xampp with sql 5 ?

if it's yes : with glpi 6.0

functions.php in glpi/glpi/softwares

modify

$query_inst = "SELECT glpi_inst_software.ID AS ID, glpi_inst_software.license AS lID, glpi_computers.deleted as deleted, ";
$query_inst .= " glpi_infocoms.ID as infocoms, ";
$query_inst .= " glpi_computers.ID AS cID, glpi_computers.name AS cname FROM glpi_licenses, glpi_inst_software ";
$query_inst .= " INNER JOIN glpi_computers ON (glpi_computers.deleted='N' AND glpi_computers.is_template='0' AND glpi_inst_software.cID= glpi_computers.ID) ";
$query_inst .= " LEFT JOIN glpi_infocoms ON (glpi_infocoms.device_type='".LICENSE_TYPE."' AND glpi_infocoms.FK_device=glpi_licenses.ID) ";
$query_inst .= " WHERE $SEARCH_LICENCE ";
       
$query_inst.= " AND glpi_inst_software.license = glpi_licenses.ID";   
       
$result_inst = $db->query($query_inst);
$num_inst=$db->numrows($result_inst);

to

$query_inst = "SELECT glpi_inst_software.ID AS ID, glpi_inst_software.license AS lID, glpi_computers.deleted as deleted, ";
        $query_inst .= " glpi_infocoms.ID as infocoms, ";
        $query_inst .= " glpi_computers.ID AS cID, glpi_computers.name AS cname FROM glpi_licenses";
                $query_inst .= " INNER JOIN glpi_inst_software ";
        $query_inst .= " ON ( glpi_inst_software.license = glpi_licenses.ID )";
        $query_inst .= " INNER JOIN glpi_computers ON (glpi_computers.deleted='N' AND glpi_computers.is_template='0' AND glpi_inst_software.cID= glpi_computers.ID) ";
        $query_inst .= " LEFT JOIN glpi_infocoms ON (glpi_infocoms.device_type='".LICENSE_TYPE."' AND glpi_infocoms.FK_device=glpi_licenses.ID) ";
        $query_inst .= " WHERE $SEARCH_LICENCE ";

or use the cvs if you are in beta test of glpi (it's corrected)

Last edited by tsmr (2006-01-06 16:19:51)


Xavier Caillaud
Blog GLPI Infotel

Offline

#5 2006-01-06 16:22:16

mbergevoet
Member
Registered: 2006-01-06
Posts: 12

Re: Mysql error in software/classes

Great this works :-) problem solved smile thank you

Offline

Board footer

Powered by FluxBB