Open yingwuqian opened 4 years ago
Echo your $query. So put that on the screen. Maybe the easiest place to do that is to change
echo 'Input failed!';
to
echo '$query';
After that check the query you are outputting against the database (use PMA to test) and see if there is a query issue
Sorry it should be like this
echo '$sql';
after input the echo '$sql'; it show the
Your code is not loading anymore on the server.
But the idea is the following, make the $sql appear some where, so you can try to check it for any issues.
@jslemmer Hi! Jons. Can you check this code for me? I made a dynamic bus route table which can drag and drop to modify the date and time of the bus times, but inserting data from the web page always shows input failed, it can only insert from the database. I think there's a little problem with the query. @https://l5k2b.instantcloud.cn/login.php username: Alisa password: 0000
`<?php
include_once('db.php');
$action = $_GET['action']; if ($action == 'add') { $title = $_POST['title']; $allday = $_POST['allday'] == 'true' ? 1 : 0; $startdate = trim($_POST['startdate']); $s_time = $_POST['s_hour'] . ':' . $_POST['s_minute']; $starttime = strtotime($startdate . ' ' . $s_time);
} else if ($action == "drag") { $id = $_POST['id']; $daydiff = (int) $_POST['daydiff'] 24 60 * 60; $minudiff = (int) $_POST['minudiff'] / 1000; $allday = $_POST['allday'] == 'true' ? 1 : 0; $difftime = $daydiff + $minudiff;
} ?>`