I very recently started learning php, and with the help of some examples I managed to make this code (mainly from W3Schools):
<?php
$con=mysqli_connect("Data Removed for Privacy");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql= "INSERT INTO EventRecord (PlayerName, EventType, Value, Time)
VALUES
('$_Get[PlayerName]', '$_Get[Event]' ,'$_Get[Value]' ,'$_Get[Time]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";
mysqli_close($con);
?>
However, when doing something like
http://example.com/MyData.php?PlayerName=Test2&EventType=Test&Value=Test&Time=500
It comes up in my database as all of the values being null.
Additional information: The table has 5 columns, the four noted above and EventId (primary index, auto-incrementing). Sorry if this is a stupid question or I did anything wrong.