DO NOT DEAL WITH THIS MEMBER
Hello everyone,
Im stuck on this final part!
I retrieve the following variables from my postback fine:
$id = $_GET["id"];
$old = $_GET["old"];
$amount = $_GET["amount"];
$currency_name = $_GET["currency_name"];
$user_id = $_GET["user_id"];
$payout = $_GET["payout"];
$o_name = $_GET["o_name"];
$sig = $_GET["sig"];
Im connected to my database fine.
But inserting the infomation is where im stuck...
I want to instert the amount into a row called 'robux' where the row 'username' equals user_id ! Please help! :O
What do you mean username equals user_id? Are they in the same table?
DO NOT DEAL WITH THIS MEMBER
Dec 18, 2017 01:12 PM
(This post was last modified: Dec 18, 2017 01:15 PM by JAS.)
(Dec 18, 2017 01:03 PM)undeRq Wrote: What do you mean username equals user_id? Are they in the same table?
Yes here is the table:
Thanks for help
(Dec 18, 2017 01:11 PM)Charger Wrote: http://php.net/manual/en/pdo.prepared-statements.php
First result on google.
I really need help though because im not familiar with sql
That table is called users by the way.
Do you have skype? I can help you on skype if you want.
DO NOT DEAL WITH THIS MEMBER
(Dec 18, 2017 01:51 PM)undeRq Wrote: Do you have skype? I can help you on skype if you want.
No sorry, please dont be afraid to help here though.
(Dec 18, 2017 01:12 PM)JAS Wrote: Yes here is the table:
![[Image: cvw40O.png]](https://vgy.me/cvw40O.png)
Thanks for help
I really need help though because im not familiar with sql
That table is called users by the way.
Dude, it says it as soon as you scroll...
PHP Code
<?php $stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)"); $stmt->bindParam(':name', $name); $stmt->bindParam(':value', $value);
// insert one row $name = 'one'; $value = 1; $stmt->execute();
// insert another row with different values $name = 'two'; $value = 2; $stmt->execute(); ?>
Dec 18, 2017 02:37 PM
(This post was last modified: Dec 18, 2017 02:42 PM by undeRq.)
(Dec 18, 2017 02:19 PM)Charger Wrote: Dude, it says it as soon as you scroll...
PHP Code
<?php $stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)"); $stmt->bindParam(':name', $name); $stmt->bindParam(':value', $value);
// insert one row $name = 'one'; $value = 1; $stmt->execute();
// insert another row with different values $name = 'two'; $value = 2; $stmt->execute(); ?>
He is using MySQLi not PDO, and my recommendation is to switch to PDO driver.
Can you post me here how did you execute the "insert" script?
Example,
You have username, email, refferal, password, rank, robux, secondammount and date.
ID must be AI(Auto Increment), so don't insert anything there. If your ID isn't auto increment, you have an option in PHPMyAdmin when you edit row called AI.
Second, do like this $query = mysqli_query($conn, "INSERT Into {tablename} (username, email, refferal, password, rank, robux, secondammount, date.) VALUES ({$username},{$email},{$refferal},{$password},{$rank},{$robux},{$secondammount},{$date})");
then, if it's not working, just paste me output of $query like this print_r($query);
DO NOT DEAL WITH THIS MEMBER
Dec 19, 2017 08:57 AM
(This post was last modified: Dec 20, 2017 04:43 AM by JAS.)
(Dec 18, 2017 02:19 PM)Charger Wrote: Dude, it says it as soon as you scroll...
PHP Code
<?php $stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)"); $stmt->bindParam(':name', $name); $stmt->bindParam(':value', $value);
// insert one row $name = 'one'; $value = 1; $stmt->execute();
// insert another row with different values $name = 'two'; $value = 2; $stmt->execute(); ?>
Thanks but im still struggling, Here is my entire page. Hope you can see the error:
Code https://pastebin.com/raw/9s9Cb1gR
Still need help with this.
|