PHP mysqli多个查询bind_param崩溃

时间:2019-04-09 23:42:58

标签: php mysql mysqli

我有这个php代码(我的服务器是5.3),在创建多查询时崩溃。

我已经尝试删除其他查询,只有一个查询时有效,第二个崩溃。当我离开第一个查询和第二个查询时,也尝试更改SELECT语句中的属性,但仍然没有用。


$time = time();

$forum_update = $forum_db->prepare("SELECT @idpm := max(`id_pm`) 
                               FROM `smf_personal_messages`; 

SELECT @realname := `member_name`, @pmcount := `unread_messages` 
            FROM `smf_members` WHERE `id_member` = ? ; 

INSERT INTO `smf_personal_messages` 
(`id_pm_head`, `id_member_from`, `msgtime`, `from_name`, `subject`, `body`) 
VALUES (@idpm+1, ?, ?, @realname, '?', '?'); 

INSERT INTO `smf_pm_recipients` (id_pm, id_member, is_new) 
VALUES (LAST_INSERT_ID(), ?, 1); 

UPDATE `smf_members` SET `unread_messages` = (@pmcount + 1), `new_pm` = 1 
WHERE `id_member` = ?") 
or die("Could not create query");

$forum_update->bind_param('dddssdd', $fprofile, $fprofile, $time, $subject,
$body, $fprofile, $fprofile);

0 个答案:

没有答案