- Messages
- 228
- Reaction score
- 13
- Points
- 38
Help naman po nag eerror po kasi yung input code ko, eto po error nya
Error: INSERT INTO daily_data (date, main, spillinglvl, sldiff, orc, orcdiff, aveinflow, aya, masiway, idr, rf, avi ) VALUES ('2019-07-30', '7', '7', '7', '7', '7', '7', '4', '7', '5', '6', '7',)
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 2
create.php
Error: INSERT INTO daily_data (date, main, spillinglvl, sldiff, orc, orcdiff, aveinflow, aya, masiway, idr, rf, avi ) VALUES ('2019-07-30', '7', '7', '7', '7', '7', '7', '4', '7', '5', '6', '7',)
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 2
create.php
Code:
<?php
include ("db/connection.php");
if ($conn->connect_error) {
die ("Connection Failed" . $conn->connect_error);
}
$date = $_POST['date'];
$main = $_POST['main'];
$spillinglvl = $_POST['spillinglvl'];
$sldiff = $_POST['sldiff'];
$orc = $_POST['orc'];
$orcdiff = $_POST['orcdiff'];
$aveinflow = $_POST['aveinflow'];
$aya = $_POST['aya'];
$masiway = $_POST['masiway'];
$idr = $_POST['idr'];
$rf = $_POST['rf'];
$avi = $_POST['avi'];
$sql = "INSERT INTO daily_data (date, main, spillinglvl, sldiff, orc, orcdiff, aveinflow, aya, masiway, idr, rf, avi ) VALUES
('$date', '$main', '$spillinglvl', '$sldiff', '$orc', '$orcdiff', '$aveinflow', '$aya', '$masiway', '$idr', '$rf', '$avi',)"
or die (mysql_error());
if ($conn->query($sql) === TRUE) {
header("Location:index.php");
}
else
{
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>