小编ech*_*er'的帖子

如何在phpword表中的单元格中换行?

我想根据.docx数据库中存在的数据创建一个word文件。为此,我使用的是phpword 0.12.0。我需要画一张表将数据放入其中。之后,我需要从数据库的表中获取每一行以自动进入换行的单元格。我可以用

$section->addTextBreak();
Run Code Online (Sandbox Code Playgroud)

但是没有表,现在如何在表内的单元格中执行此工作?我正在使用下面的代码,但是它不起作用。

$area=array();
$axis=array();
$topic=array();
$table->addRow(900);
$table->addCell(2000, $styleCell)->addText(htmlspecialchars('test1'), $fontStyle);
$table->addCell(2000, $styleCell)->addText(htmlspecialchars('test2'), $fontStyle);
$table->addCell(2000, $styleCell)->addText(htmlspecialchars('test3'), $fontStyle);
$table->addCell(2000, $styleCell)->addText(htmlspecialchars('test4'), $fontStyle);
for ($i = 0; $i < 4; $i++) {
      $table->addRow();
      $table->addCell(2000)->addText(htmlspecialchars($topic{$i}),array('name' => 'Segoe UI Semilight'));
      $table->addCell(3000)->addText(htmlspecialchars($axis{$i}),array('rtl' => true,'name' => 'Segoe UI Semilight'));
      $table->addCell(2000)->addText(htmlspecialchars($area{$i}),array('rtl' => true,'name' => 'Segoe UI Semilight'));
      $table->addCell(2000)->addText(htmlspecialchars($i),array('rtl' => true,'name' => 'Segoe UI Semilight'));
}
Run Code Online (Sandbox Code Playgroud)

php mysql phpword

3
推荐指数
1
解决办法
4003
查看次数

使用 OpenQuery 插入表

我有两个数据库MSSQLMYSQL

我想将数据从 MYSQL 传输到 MSSQL,结果我在它们之间创建了链接服务器

在这一步之前我没有任何问题

我写了下面的代码从 MYSQL 获取数据并插入到 MSSQL

INSERT into dbo.test2016
SELECT * FROM openquery(test1, 'SELECT t_id,t_date
FROM test1.test2016') T1
INNER JOIN dbo.test2016 T2 ON T1.t_date > T2.t_date
Run Code Online (Sandbox Code Playgroud)

但我在MSSQL中遇到Msg 213, Level 16, State 1, Line 1 因为INNER JOIN无法与INSERT INTO匹配

我需要在插入 MSSQL 之前比较两个表之间的 t_date 列

我能怎么做?

mysql sql-server linked-server

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

mysql ×2

linked-server ×1

php ×1

phpword ×1

sql-server ×1