php - 连接行上的 db 值
问题描述
我想将此数据库值连接成一行,但我没有这样做。谁能帮我解决这个问题?非常感谢!
<tr>
<td><?php echo $i;$i++; ?></td>
<td><?php print($row['vfname'. " " & 'vmname' & " " & 'vlname']); ?></td>
<td><?php print($row['vage']); ?></td>
<td><?php print($row['vprecinct']); ?></td>
<td><?php print($row['vworkstat']); ?></td>
<td><?php print($row['vleaders']); ?></td>
<td><?php print($row['vclass']); ?></td>
<td><?php print($row['vaddress']); ?></td>
<td><?php print($row['vcontact']); ?></td>
<td><?php print($row['vdatereg']); ?></td>
</tr>
解决方案
完毕。我在sql语句中连接它希望这对任何人都有帮助
$tablecontent = '';
$start = '';
$selectStmt = $con->prepare("SELECT vaddress, Concat(vfname, ' ', vmname, ' ', vlname) AS Name, vage, vcontact, vworkstat, vclass, vprecinct, vleaders, vdatereg FROM votersinfotbl ORDER BY vaddress ASC");
$selectStmt->execute();
$votersinfotbl = $selectStmt->fetchAll();
推荐阅读
- r - 如何根据日期差异对数据框进行子集化?
- c# - 我可以在不使用反射的情况下获取类中的字段或属性的 PropertyInfo 吗?
- javascript - React 应用程序的 Webpack 再生器编译问题
- reactjs - 如何将文本字段设置为禁用,并且在键入时将再次启用?
- drake - 使用 autoDiffToGradientMatrix 的一些问题
- android - 未从通知托盘中获取捆绑包中的 Pubnub 有效负载。当应用程序被杀死时
- excel - 我们能否将 sharepoint 中的电子表格连接到 Einstein Analytics
- spring - 如何在 Spring Boot 中创建具有自定义授权类型的 WebClient
- javascript - Express-validator:规范化的电子邮件字段是否不需要清理?
- machine-learning - 使用混淆矩阵进行聚类准确性检查