You need a space after your table name. Otherwise it looks like a function.
mysql_query("INSERT INTO accounting(transid, unixtime, username, description, amount, type, time) VALUES('$randomtransid', '0', '$yti', 'BLVD Offer Completion', '$theamount', 'points', '$dateandtime')");
^^^^^^^
HERE
Should be:
mysql_query("INSERT INTO accounting (transid, unixtime, username, description, amount, type, time) VALUES('$randomtransid', '0', '$yti', 'BLVD Offer Completion', '$theamount', 'points', '$dateandtime')");
A few notes:
If you checked for error in your code you would have caught this quickly and easily. Always look for and handle errors. In your case a call to
mysql_error()
would have done the trick.You shouldn't use
mysql_*
functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO, or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.Since I can't see you handling this explicitly in your code I must assume you are wide open to SQL injections.