Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try {
- $testdata = array('tdate' => '12.06.2021', 'ttime' => '23:16:20', 'consult' => 'cons1', 'price' => rand(1000, 4000), 'cname' => 'Test User', 'phone' => '899999999999', 'bdate' => '01.01.1999', 'btime' => '16:32:32', 'bplace' => 'Москва', 'email' => '[email protected]', 'question' => 'lorem');
- $file_db = new PDO('sqlite:db.sqlite3');
- $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $insert = "INSERT INTO tasks (tdate, ttime, consult, price, cname, phone, bdate, btime, bplace, email, question) VALUES (:tdate, :ttime, :consult, :price, :cname, :phone, :bdate, :btime, :bplace, :email, :question)";
- $stmt = $file_db->prepare($insert);
- $stmt->execute($testdata);
- $send_stat['status'] = 1;
- echo json_encode($send_stat);
- } catch (PDOException $e) {
- echo $e->getMessage();
- }
Advertisement
Add Comment
Please, Sign In to add comment