Git Product home page Git Product logo

Comments (2)

Olafejs avatar Olafejs commented on August 16, 2024

Podbijam

from paynow-prestashop.

Olafejs avatar Olafejs commented on August 16, 2024

Gdyby ktoś nie miał czasu czekać na naprawę tego błędu to skrypt kopiujący dane w poprawne pola:

`<?php
// Połączenie z bazą danych
$db_host = 'XXX';
$db_user = 'XXX'; // Zastąp swoją nazwą użytkownika
$db_password = 'XXX'; // Zastąp swoim hasłem
$db_name = 'XXX';

$mysqli = new mysqli($db_host, $db_user, $db_password, $db_name);

if ($mysqli->connect_error) {
die('Błąd połączenia: ' . $mysqli->connect_error);
}

// Ustawienie kodowania znaków dla połączenia
$mysqli->set_charset("utf8mb4");

// Pobranie danych z tabeli pspt_paynow_payments
$query = "SELECT * FROM pspt_paynow_payments";
$result = $mysqli->query($query);

if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$order_reference = $row['order_reference'];
$total = $row['total'];
$id_payment = $row['id_payment'];
$created_at = $row['created_at'];

    // Ustawienie stałych wartości
    $id_currency = 2;
    $payment_method = 'Zapłać z paynow.pl';
    $conversion_rate = 1.000000;

    // Domyślne wartości dla kolumn związanych z kartą
    $card_number = '';
    $card_brand = '';
    $card_expiration = '';
    $card_holder = '';

    // Wstawienie danych do tabeli pspt_order_payment
    $insert_query = "INSERT INTO pspt_order_payment (order_reference, id_currency, amount, payment_method, conversion_rate, transaction_id, card_number, card_brand, card_expiration, card_holder, date_add) VALUES ('$order_reference', $id_currency, $total, '$payment_method', $conversion_rate, '$id_payment', '$card_number', '$card_brand', '$card_expiration', '$card_holder', '$created_at')";
    if (!$mysqli->query($insert_query)) {
        echo "Błąd przy wstawianiu danych: " . $mysqli->error;
    }
}

} else {
echo "Brak danych do skopiowania.";
}

$mysqli->close();
?>
`

from paynow-prestashop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.