38682-vm/test_prepare.php
Flatlogic Bot 4dbf9aec32 test
2026-04-03 10:38:17 +00:00

22 lines
1.0 KiB
PHP

<?php
require_once 'db/config.php';
try {
$pdo = db();
$q = "UPDATE orders SET
source = ?,
outlet_id = ?, table_id = ?, table_number = ?, order_type = ?,
customer_id = ?, customer_name = ?, customer_phone = ?, car_plate = ?, ready_time = ?,
payment_type_id = ?, total_amount = ?, discount = ?, vat = ?, user_id = ?,
commission_amount = ?, status = 'pending'
WHERE id = ?";
$stmt = $pdo->prepare($q);
echo "Update params count: " . preg_match_all('/\?/', $q) . "\n";
$q2 = "INSERT INTO orders (source, outlet_id, table_id, table_number, order_type, customer_id, customer_name, customer_phone, car_plate, ready_time, payment_type_id, total_amount, discount, vat, user_id, commission_amount, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'pending')";
$stmt2 = $pdo->prepare($q2);
echo "Insert params count: " . preg_match_all('/\?/', $q2) . "\n";
} catch (Exception $e) {
echo $e->getMessage();
}