Advertisement
Ihssane123

Untitled

Feb 1st, 2024
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.12 KB | Source Code | 0 0
  1. // this is the code
  2. if($conn) {
  3.     if ($_SERVER["REQUEST_METHOD"] == "POST") {
  4.         $just = $_POST["just"];
  5.         $sql_ref = "UPDATE adopteur
  6.        SET etat_demande = 'acceptee', explication = '{$just}'
  7.        WHERE id_adopteur = {$id_adopteur}";
  8.         // executer la requete        
  9.         $query = mysqli_query($conn,$sql_ref);
  10.         if($query) {
  11.             echo "<script>confirm('updated')</script>";
  12.             header("location:$url");
  13.         }
  14.         else {
  15.             echo "<script>confirm('not updated')</script>";
  16.         }
  17.     }
  18. }
  19. // this is the error i get
  20. Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'accepte cette demande parceque je suis entrain de tester' WHERE id_a...' at line 2 in C:\xampp\htdocs\adoption_website\info_demand_accepte.php:15 Stack trace: #0 C:\xampp\htdocs\adoption_website\info_demand_accepte.php(15): mysqli_query(Object(mysqli), 'UPDATE adopteur...') #1 {main} thrown in C:\xampp\htdocs\adoption_website\info_demand_accepte.php on line 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement