I am inserting data into tables and also updating tables in my database using PDO which I am admittedly not the most knowledgeable about.
I am using a statement that I have used many times in the past, but for some reason this time it doesn't work for the prepared insert statement. It only worked for the update statement.
The statement is as follows:
error_reporting(E_ALL);
ini_set('display_errors',1);
//fetching error
$stmt = $pdo->prepare("INSERT INTO tb_beli (username, bank, norek, nama, ec, bitcoin, perfectmoney, fasapay, paket, saldo, amountbtc, phone, email, status, referer, iddb, date, ip, exp, unik,idph, upline, token)
VALUES(:username, :bank, :norek, :nama, :ec, :bitcoin, :perfectmoney, :fasapay, :paket, :saldo, :amountbtc, :phone, :email, :status, :referer, :iddb, :date, :ip, :exp, :unik, :idph, :upline, :token)");
$stmt ->execute(array(':username' => $kuriree, ':bank' => $bankee, ':norek' => $norekee, ':nama' => $namaee, ':ec' => $matauang, ':bitcoin' => $bitcoinee, ':perfectmoney' => $pmee, ':fasapay' => $fasapayee, ':paket' => $paketzee, ':saldo' => $surabayae, ':amountbtc' => $convertbtc2, ':phone' => $phoneee, ':email' => $emailee, ':status' => $status1,':referer' => $kurirz,':iddb' => $idnyaz,':date' => $skrg,':ip' =>$laip ,':exp' => $exp,':unik' => $unikee,':idph' => $idnyaee,':upline' => $mangkosim,':token' => $unikeef ));
//
//echo done
$stmt = $pdo->prepare("INSERT INTO tb_jual (username, bank, norek, nama, ec, bitcoin, perfectmoney, fasapay, paket, saldo, amountbtc, phone, email, status, date, ip, idgh, token)
VALUES(:username, :bank, :norek, :nama, :ec, :bitcoin, :perfectmoney, :fasapay, :paket, :saldo, :amountbtc, :phone, :email, :status, :date, :ip, :idgh, :token)");
$stmt ->execute(array(':username' => $kurirz, ':bank' => $bankeem, ':norek' => $norekeem, ':nama' => $namaeem, ':ec' => $matauang, ':bitcoin' => $bitcoineem, ':perfectmoney' => $pmeem, ':fasapay' => $fasapayeem, ':paket' => $paketzee, ':saldo' => $surabayae, ':amountbtc' => $convertbtc2, ':phone' => $phoneeem, ':email' => $emaileem, ':status' => $status2, ':date' => $skrg, ':ip' => $laip, ':idgh' => $idnyaz, ':token' => $unikeef));
//
//echo done
$stmt= $pdo->prepare("UPDATE tb_ph SET saldo= (saldo - :saldo) where id=:id ");
$stmt ->execute(array(':id' => $idnyaee, ':saldo' => $surabayae));
//
//echo done
$stmt= $pdo->prepare("UPDATE tb_gh SET saldo= (saldo - :saldo) where id=:id");
$stmt->execute(array(':id' => $idnyaz , ':saldo' => $surabayae));
//echo done
//array ends here for checkup
But unfortunately this is always returning to be TRUE
without any data to the database tables. only updating, which was supposed to be done after the insertion into my database.
I have tried every combination changes to the statement that I could think of, but I am still at a loss. Also it doesn't return any error.