PHP Code:
$vbulletin->db->query_write("
INSERT INTO " . TABLE_PREFIX . "ph_order
(userid, username, itemid, itemname, itemtype, productid, productname, price, quantity, date, length, active)
VALUES
(" . intval($user[0]) . ", " . intval($user[1]) . ", " . intval($item['id']) . ", '" . $vbulletin->db->escape_string($item['name']) . "', " . intval($type) . ", " . intval($product['id']) . ", '" . $vbulletin->db->escape_string($product['name']) . "', '" . $vbulletin->db->escape_string($item['price']) . "', " . intval($temp[1]) . ", " . TIMENOW . ", " . intval($item['length']) . ", 1)
");