There's a few things you can do on your own to track down the error.
Do all the $_POST variables have values? If any are not set, your code doesn't run the query. Check with:
PHP Code:
print_r($_POST);
If it's getting to the query, add:
PHP Code:
mysql_query($query) or die(mysql_error());
To see what the error is.
You could also echo the $query string to see what it looks like populated and before it executes. There might be something MySQL doesn't like about '$var'. Maybe try,
PHP Code:
VALUES ('" . $var . "')
...notice the single/double quotes.
It looks like you might be missing some ")" and the closing "}" for your IF condition... though that would give you a parse error.
And on a side not in reagards to security, you should be sanitizing any post/get variables before putting them directly in your query - especially since you're using the old mysql drivers.
Bookmarks