99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2019-02-25 閱讀量: 890
group_concat造成的sql語法錯誤

問題描述:

$sql_id = "select group_concat(`table_a_id`) from `table_b`";
$id_str = $db->execute($sql_id);

$sql = "select * from `table_a` where `id` in ( {$id_str} ) and `is_effect` = 1`";
$res = $db->execute($sql);

/*
error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
syntax to use near ') and `is_effect` = 1'
*/
// 完整sql: select * from `table_a` where `id` in ( 1,2,3,4, ) and `is_effect` = 1`

解決方法:

sql中多了一個(gè)逗號

group_concat執(zhí)行結(jié)構(gòu)有大小限制,會根據(jù)byte大小進(jìn)行截取

0.0000
0
關(guān)注作者
收藏
評論(0)

發(fā)表評論

暫無數(shù)據(jù)
推薦帖子