Ошибка установки связи с курсом.

$curPage:
int(18135)
$Qset:
array(55) { [0]=> array(2) { ["id"]=> int(34554) ["page"]=> int(34552) } [1]=> array(2) { ["id"]=> int(34511) ["page"]=> int(34513) } [2]=> array(2) { ["id"]=> int(31707) ["page"]=> int(32413) } [3]=> array(2) { ["id"]=> int(31710) ["page"]=> int(31714) } [4]=> array(2) { ["id"]=> int(31622) ["page"]=> int(10831) } [5]=> array(2) { ["id"]=> int(31625) ["page"]=> int(10831) } [6]=> array(2) { ["id"]=> int(26038) ["page"]=> int(26024) } [7]=> array(2) { ["id"]=> int(25210) ["page"]=> int(25211) } [8]=> array(2) { ["id"]=> int(21396) ["page"]=> int(21397) } [9]=> array(2) { ["id"]=> int(17855) ["page"]=> int(17856) } [10]=> array(2) { ["id"]=> int(17615) ["page"]=> int(17611) } [11]=> array(2) { ["id"]=> int(16517) ["page"]=> int(25243) } [12]=> array(2) { ["id"]=> int(16327) ["page"]=> int(10128) } [13]=> array(2) { ["id"]=> int(15945) ["page"]=> int(15953) } [14]=> array(2) { ["id"]=> int(14266) ["page"]=> int(14235) } [15]=> array(2) { ["id"]=> int(14182) ["page"]=> int(14133) } [16]=> array(2) { ["id"]=> int(13930) ["page"]=> int(7731) } [17]=> array(2) { ["id"]=> int(13414) ["page"]=> int(13413) } [18]=> array(2) { ["id"]=> int(11887) ["page"]=> int(11885) } [19]=> array(2) { ["id"]=> int(8981) ["page"]=> int(31616) } [20]=> array(2) { ["id"]=> int(8774) ["page"]=> int(8776) } [21]=> array(2) { ["id"]=> int(7986) ["page"]=> int(9185) } [22]=> array(2) { ["id"]=> int(7984) ["page"]=> int(475) } [23]=> array(2) { ["id"]=> int(7981) ["page"]=> int(15116) } [24]=> array(2) { ["id"]=> int(7979) ["page"]=> int(4997) } [25]=> array(2) { ["id"]=> int(7976) ["page"]=> int(4997) } [26]=> array(2) { ["id"]=> int(7974) ["page"]=> int(317) } [27]=> array(2) { ["id"]=> int(7972) ["page"]=> int(409) } [28]=> array(2) { ["id"]=> int(7970) ["page"]=> int(406) } [29]=> array(2) { ["id"]=> int(7968) ["page"]=> int(14634) } [30]=> array(2) { ["id"]=> int(7966) ["page"]=> int(8901) } [31]=> array(2) { ["id"]=> int(7964) ["page"]=> int(389) } [32]=> array(2) { ["id"]=> int(7961) ["page"]=> int(8913) } [33]=> array(2) { ["id"]=> int(7959) ["page"]=> int(13174) } [34]=> array(2) { ["id"]=> int(7957) ["page"]=> int(16138) } [35]=> array(2) { ["id"]=> int(7955) ["page"]=> int(18235) } [36]=> array(2) { ["id"]=> int(7953) ["page"]=> int(16335) } [37]=> array(2) { ["id"]=> int(7951) ["page"]=> int(422) } [38]=> array(2) { ["id"]=> int(7949) ["page"]=> int(432) } [39]=> array(2) { ["id"]=> int(7947) ["page"]=> int(15111) } [40]=> array(2) { ["id"]=> int(7944) ["page"]=> int(11070) } [41]=> array(2) { ["id"]=> int(7941) ["page"]=> int(316) } [42]=> array(2) { ["id"]=> int(7935) ["page"]=> int(15082) } [43]=> array(2) { ["id"]=> int(7933) ["page"]=> int(440) } [44]=> array(2) { ["id"]=> int(7931) ["page"]=> int(4007) } [45]=> array(2) { ["id"]=> int(7928) ["page"]=> int(10009) } [46]=> array(2) { ["id"]=> int(7923) ["page"]=> int(452) } [47]=> array(2) { ["id"]=> int(7920) ["page"]=> int(14597) } [48]=> array(2) { ["id"]=> int(7907) ["page"]=> int(8940) } [49]=> array(2) { ["id"]=> int(7903) ["page"]=> int(449) } [50]=> array(2) { ["id"]=> int(8189) ["page"]=> int(380) } [51]=> array(2) { ["id"]=> int(7885) ["page"]=> int(17911) } [52]=> array(2) { ["id"]=> int(8525) ["page"]=> int(467) } [53]=> array(2) { ["id"]=> int(8521) ["page"]=> int(470) } [54]=> array(2) { ["id"]=> int(8517) ["page"]=> int(456) } }
index:
bool(false)