1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<?php
$db=mysql_connect('localhost','root','root') or die("conection errone");
mysql_select_db('glpi',$db) or die("erreur");
$query=("INSERT INTO `affichev`
SELECT LETTER, SSN, `glpi_computers`.name, date_mod, completename
FROM `OCSWEB`.`bios`
INNER JOIN `OCSWEB`.`hardware` ON `OCSWEB`.`bios`.hardware_id
= `OCSWEB`.`hardware`.ID
INNER JOIN`OCSWEB`.`ancienhardware` ON `OCSWEB`.`bios`.hardware_id = `OCSWEB`.`ancienhardware`.hardware_id
INNER JOIN `GLPI`.`glpi_computers` ON `OCSWEB`.`bios`.SSN = `GLPI`.`glpi_computers`.serial
INNER JOIN `GLPI`.`glpi_dropdown_locations` ON `GLPI`.`glpi_computers`.location = `GLPI`.`glpi_dropdown_locations`.ID");
$result=mysql_query($query) ;
$req=mysql_query("select `LETTER`,`SSN`,`name`,`date_mod`,`completename` from affichev");
while ($resultat = mysql_fetch_array($req))
{
print "<strong>LETTER:</strong> $resultat[LETTER]";
print "<p><strong>SSN:</strong>$resultat[SSN]</p>";
print "<p><strong>name:</strong>$resultat[name]</p>";
print "<p><strong>date_mod:</strong>$resultat[date_mod]</p>";
print "<p><strong>completename:</strong>$resultat[completename]</p>";
}
mysql_close();
?> |
Partager