Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

postback help , mysqli functions!

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?
http://php.net/manual/en/pdo.prepared-statements.php


First result on google.
(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:
[Image: cvw40O.png]

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.
(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]

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: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);
(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.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by CodepacksJun 26, 2019 08:20 PM 3 177 Jun 26, 2019 08:20 PM
Last Post: Oxycodone
[PHP] by SharoKurdiFeb 16, 2018 02:41 PM 10 416 Feb 16, 2018 02:41 PM
Last Post: blackcoder00
[PHP] by JASDec 7, 2017 02:35 PM 4 183 Dec 7, 2017 02:35 PM
Last Post: Charger