Bonjour tout le monde
je galère avec ça:
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 <?php include '../commande/commande.php'; session_start(); $ssh=connexionSSH($_SESSION['ip'],$_SESSION['loginssh'],$_SESSION['mdpssh']); $server="localhost"; $user="root"; $pwd=""; $db="audit"; if(dbConnect($server,$user,$pwd,$db)){ $partition=getPartitionInfo($ssh); $date='2014-04-01'; $temps='12:11:12'; $idDisk='1'; for($i=1;$i<count($partition);$i++){ if(trim($partition[$i]) != ''){ $a=explode(' ',trim($partition[$i])); $m=trim($a[1]); $nom_partition=$m."_server1"; $pourcentage=substr(trim($a[0]),0,strlen(trim($a[0]))-1); $m=trim($a[1]); $req="INSERT INTO partition(nom_partition,pourcentage,mont,date,temps,id_disk) VALUES('".$nom_partition."','".$pourcentage."','".$m."','".$date."','".$temps."','".$idDisk."');"; if($result = mysql_query($req)) { echo "bien ajouté<br>"; } else{echo mysql_error();}}} }?>
il me donne toujours ce message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'partition(nom_partition,pourcentage,mont,date,temps,id_disk) VALUES('/_server1',' at line 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'partition(nom_partition,pourcentage,mont,date,temps,id_disk) VALUES('/boot_serve' at line 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'partition(nom_partition,pourcentage,mont,date,temps,id_disk) VALUES('/dev/shm_se' at line 1
je suis vraiment perdu ?votre aide SVP
Partager