Quote:
Originally Posted by sheppardzwc
All MySQL statements that involve INSERT have to have all the variables/strings encased with an apostrophe. In basic terms, the correct statement would be:
PHP Code:
$db->query_write("INSERT INTO " . TABLE_PREFIX . "attachmentDownloadHistory (userid, host, attachmentid) VALUES ('$userId', '$sessionId', '$attachId')");
So basically, each variable after VALUES needs to have an apostrophe around it.
As well, you can also just use this for the queries instead of $db->, to cut down on processing time for PHP with "global:"
PHP Code:
global $vbulletin; $vbulletin->db->query_write(whatever);

|
This is not correct, numeric columns do not need to be quoted, it is even against the coding standards to do so.