| 12
 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
 
 |  
 
 
<?php
$mysqli = new mysqli("localhost","20gklm_utilifgh","abk3mp8fg","20gklm_mytestbase");
 
 
 
if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}
 
 
if ($result = $mysqli -> query("select value,monte from module_sequence_fieldval where fielddef_id = 17")) {
 
while ($row = mysqli_fetch_assoc($result)) {
 
if (strpos($row["value"]," - Arr",12) !== false)  {$pos=strpos($row["value"]," - Arr",12);} else {$pos=14;};
    $bontitre=strtolower(substr($row["value"],0,$pos)).".pdf";
    $bontitre=str_replace(" ","",$bontitre);
    $bontitre=str_replace("..",".",$bontitre);
    $i= $row["monte"];
 
    $ajour=$mysqli -> query('update module_sequence_fieldval  set value="' .$bontitre.'" where fielddef_id = 17 and monte = "' .$i. '"' );
$ajour;
 
 
 
 
 
}
}
 
 
$mysqli -> close();
?> | 
Partager