Originally posted by mmepokman:
But as mentioned, shouldnt my original code work if there is only 1 column. This is because my table user has only 1 col (name) and yet the code is not working.
PHP:
$query = "INSERT INTO user Values = '" . $login . "'";
Why is this so?
In fact, this query should work with a single-column table! However, in your very first post, you had another syntax:
$query = "INSERT INTO user VALUES (".$login.")";
This one will work with numeric fiels, but not with character fields.
If in doubt, always quote your values; you won't be wrong with that.