您好我想知道以下查询的答案,
案例1:从特定字段“消息”中检索数据
---------------------------
id | Messages
---------------------------
1 | "here LARGE Text...
案例2:从表格中检索所有“消息”数据。
---------------------------
id | Messages
---------------------------
1 | "here LARGE Text...
---------------------------
2 | "here another LARGE Text...
答案 0 :(得分:0)
TEXT
数据类型的最大大小为 65,535字节 - reference TEXT
,或者,如果太长, MEDIUMTEXT
(16,777,215字节~16MB) - < EM> reference // Create connection
$dbh = new PDO('mysql:host=localhost;dbname=testdb;charset=utf8', 'username', 'password');
//Create and execute query
$stmt = $dbh->query("SELECT `messages` FROM `table`");
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach($rows as $row){
echo $row["messages"];
}