我正在爲vbulletin編寫插件,其中包括創建新線程 - 下面的查詢是我所做的。查詢在phpmyadmin中完美運行,但在php文件中運行時不會執行;沒有錯誤報告。誰能告訴我如何解決這個問題?非常感謝你!查詢不會在vbulletin中執行php
mysql_query("INSERT INTO `thread` (`threadid`, `title`, `prefixid`, `firstpostid`, `lastpostid`, `lastpost`, `forumid`, `pollid`, `open`, `replycount`, `hiddencount`, `deletedcount`, `postusername`, `postuserid`, `lastposter`, `dateline`, `views`, `iconid`, `notes`, `visible`, `sticky`, `votenum`, `votetotal`, `attach`, `similar`, `taglist`, `awardedcredits`, `threaddesc`)
VALUES (NULL, '$mname', '', '0', '0', '0', '$M4rumid', '0', '1', '0', '0', '0', '$username', '$userid', '$username', '$date', '0', '0', '', '1', '0', '0', '0', '0', '', NULL, '0', 'awarded');
SET @threadid = LAST_INSERT_ID();
INSERT INTO `post` (`postid`, `threadid`, `parentid`, `username`, `userid`, `title`, `dateline`, `pagetext`, `allowsmilie`, `showsignature`, `ipaddress`, `iconid`, `visible`, `attach`, `infraction`, `reportthreadid`, `kbank`, `post_thanks_amount`)
VALUES (NULL, @threadid, '0', '$username', '$userid', '$mname', '$date', '$postcontent', '1', '1', '', '0', '1', '0', '0', '0', '0.00', '0');
SET @postid = LAST_INSERT_ID();
UPDATE `thread`
SET `firstpostid` = @postid,
`lastpostid` = @postid,
`lastpost` = '$date'
WHERE `threadid` = @threadid;
UPDATE `user`
SET `posts` = `posts`+1
WHERE `userid` = '$userid';");
謝謝,我不知道._。有無論如何運行多個查詢? – user1985916
是的,用sgeddes建議的** mysqli_multi_query **,但你應該堅持使用vBulletin語法。 –
謝謝,還有一個問題,如果我繼續使用mysql_query(),有什麼問題嗎? – user1985916