First of all sorry if this is a daft question, this is my first MySql Project.
I'm writing a very basic application for an event. The idea is that the checkpoint staff enters a team number and a time, and it goes to the database. I've built a basic script in WAMP and now I'm putting it on my webserver im getting this error
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Arrival) VALUES ('')('4568')' at line 1
this is my code for the script
<?php
$con=mysqli_connect("localhost","","","");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to Database, Contact Control: " . mysqli_connect_error();
}
// escape variables for security
$Team = mysqli_real_escape_string($con, $_POST['Team']);
$cp = mysqli_real_escape_string($con, $_POST['cp']);
$sql="INSERT INTO checkpoints (Number, CP2 Arrival)
VALUES ('$Number', '$cp')";
if (!mysqli_query($con,$sql)) {
die('Error: ' . mysqli_error($con));
}
echo "record added";
mysqli_close($con);
?>
I've spent ages googling and trying to no luck
Any Ideas?
Thanks in advance