Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Warning: mysqli_stmt_execute() expects exactly 1 parameter, 0 given in
- if(isset($_POST['BtnSubmit'])){
- include_once 'dbConnection.php';
- if($conn -> connect_error) {
- die("connection failed:".$conn-> connect_error);
- }
- $date = $_POST['date'];
- $select_bank = $_POST['select_bank'];
- $entry_type = $_POST['entry_type'];
- $income_cat = $_POST['income_cat'];
- $amount = $_POST['amount'];
- $sql = "INSERT INTO wp_testdb (data_one, data_two, data_three, data_four, data_five) VALUES (?, ?, ?, ?, ?);";
- $stmt = mysqli_stmt_init($conn);
- if(!mysqli_stmt_prepare($stmt,$sql)) {
- echo "SQL Error !!";
- } else {
- mysqli_stmt_bind_param($stmt, "sssss", $date, $select_bank, $entry_type, $income_cat, $amount);
- mysqli_stmt_execute();
- }
- }
- <?php
- $dbServername = "localhost";
- $dbUsername = "root";
- $dbPassword = "";
- $dbName = "wordpress";
- $conn= mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
Add Comment
Please, Sign In to add comment