Почему выводится предупреждение Warning: Missing argument…?
А изображения добавляются в столбец с названием pric а не image?
Строка 173 по 185 в action.php
$res = setTypeVehicule($_POST['libelle_type_vehicule'],$_POST['price_vehicule'],$newfilename);
if($res == 1){
$_SESSION['status'] = 1;
header('Location: '.$_SERVER['HTTP_REFERER']);
}else{
$_SESSION['status'] = 2;
header('Location: '.$_SERVER['HTTP_REFERER']);
}
} else {
//echo "A error has occured uploading.";
$_SESSION['status'] = 2;
header('Location: '.$_SERVER['HTTP_REFERER']);
}
И строки в fonction php с 314 по 433
/* Start Type véhicule */
function setTypeVehicule($libelle,$prix,$pric,$image){
include("connexion.php");
$con->set_charset("utf8");
$res = '0';
$libelle = str_replace("'","\'",$libelle);
$prix = str_replace("'","\'",$prix);
$pric = str_replace("'","\'",$pric);
$date_heure = date('Y-m-d H:i:s');
$sql_verif = "SELECT id FROM tj_type_vehicule WHERE libelle='$libelle'";
$result_verif = mysqli_query($con,$sql_verif);
if(mysqli_num_rows($result_verif) > 0){
$res = '2';
}else{
$sql = "INSERT INTO tj_type_vehicule (libelle, creer, prix, pric, image) VALUES ('$libelle', '$date_heure', '$prix', '$pric', '$image')";
$result = mysqli_query($con,$sql);
if($result == 1){
$res = '1';
} else {
$res = '0';
}
}
mysqli_close($con);
return $res;
}
function setTypeVehiculeMod($id,$libelle,$prix,$pric,$image){
include("connexion.php");
$con->set_charset("utf8");
$res = '0';
$libelle = str_replace("'","\'",$libelle);
$prix = str_replace("'","\'",$prix);
$pric = str_replace("'","\'",$pric);
$date_heure = date('Y-m-d H:i:s');
$sql = "UPDATE tj_type_vehicule SET image='$image', libelle='$libelle', prix='$prix', pric='$pric', modifier='$date_heure' WHERE id=$id";
$result = mysqli_query($con,$sql);
mysqli_close($con);
return $res;
}
function getTypeVehicule(){
include("connexion.php");
$con->set_charset("utf8");
$sql = "SELECT * FROM tj_type_vehicule";
$result = mysqli_query($con,$sql);
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
$output[] = $row;
}
mysqli_close($con);
if(mysqli_num_rows($result) > 0){
return $output;
}else{
return $output = [];
}
}
function getTypeVehiculeById($id_type){
include("connexion.php");
$con->set_charset("utf8");
$sql = "SELECT * FROM tj_type_vehicule WHERE id=$id_type";
$result = mysqli_query($con,$sql);
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
$output[] = $row;
}
mysqli_close($con);
if(mysqli_num_rows($result) > 0){
return $output;
}else{
return $output = [];
}
}
function getIdTypeVehiculeByLibelle($lib_annee){
include("connexion.php");
$con->set_charset("utf8");
$sql = "SELECT id FROM tj_type_vehicule WHERE libelle='$lib_annee'";
$result = mysqli_query($con,$sql);
// output data of each row
$id = 0;
while($row = mysqli_fetch_assoc($result)) {
$id = $row['id'];
}
mysqli_close($con);
return $id;
}
function delTypeVehicule($id){
include("connexion.php");
$con->set_charset("utf8");
$sql = "DELETE FROM tj_type_vehicule WHERE id=$id";
$result = mysqli_query($con,$sql);
mysqli_close($con);
}
function getLastTypeVehicule(){
include("connexion.php");
$con->set_charset("utf8");
$sql = "SELECT * FROM tj_type_vehicule ORDER BY id DESC LIMIT 1";
$result = mysqli_query($con,$sql);
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
$output[] = $row;
}
mysqli_close($con);
if(mysqli_num_rows($result) > 0){
return $output;
}else{
return $output = [];
}
}
/* End Type véhicule */