Guest User

Untitled

a guest
Oct 19th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. Warning: mysqli_stmt_execute() expects exactly 1 parameter, 0 given in
  2.  
  3. if(isset($_POST['BtnSubmit'])){
  4.  
  5. include_once 'dbConnection.php';
  6.  
  7.  
  8.  
  9. if($conn -> connect_error) {
  10.  
  11. die("connection failed:".$conn-> connect_error);
  12. }
  13.  
  14. $date = $_POST['date'];
  15. $select_bank = $_POST['select_bank'];
  16. $entry_type = $_POST['entry_type'];
  17. $income_cat = $_POST['income_cat'];
  18. $amount = $_POST['amount'];
  19.  
  20.  
  21. $sql = "INSERT INTO wp_testdb (data_one, data_two, data_three, data_four, data_five) VALUES (?, ?, ?, ?, ?);";
  22.  
  23. $stmt = mysqli_stmt_init($conn);
  24.  
  25. if(!mysqli_stmt_prepare($stmt,$sql)) {
  26.  
  27. echo "SQL Error !!";
  28. } else {
  29.  
  30. mysqli_stmt_bind_param($stmt, "sssss", $date, $select_bank, $entry_type, $income_cat, $amount);
  31. mysqli_stmt_execute();
  32.  
  33. }
  34. }
  35.  
  36. <?php
  37.  
  38. $dbServername = "localhost";
  39. $dbUsername = "root";
  40. $dbPassword = "";
  41. $dbName = "wordpress";
  42.  
  43. $conn= mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
Add Comment
Please, Sign In to add comment