All the variables work and I can echo that on my page with all necessary information. Please note, when I run the script, it does not create any errors. It successfully writes to the database, just not where I want it to.
Also, the “id” column is the primary key and is set to auto_increment.
I swear it does. I honestly don’t get it. I’m relatively new to MySQL, but I’ve tried anything and everything I can find online and it just does not seem to work. The script is very basic and not too long. Is there anything else you need to see to help you out?
The query you are building there doesn’t look like it will be valid. All the string values – or what I assume are string values: description, email, etc… – are not quoted, which they should be.
This also supports r937’s point, that you are looking in the wrong place. Even if an UPDATE query could add a row, this one should fail with an error.
Note how I add the $email variable into the string. When you are dealing with double-quoted strings, you can insert variables directly into the string and PHP will replace them with their values. The curly-brackets around the variable name is not strictly necessary, but it is better to include them, as they make it easier to avoid problems with the variable name.
So for your query, I would do this:
$query = " UPDATE events
SET
title = '{$title}',
link = '{$link}',
date = '{$date}',
time = '{$time}',
location = '{$location}',
description = '{$description}',
contact = '{$contact}',
phone = '{$phone}',
email = '{$email}',
simple = '{$simple}'
WHERE
id = {$id}";
If any of the fields I quoted are not strings, then you would remove the quotes.