首页 > 解决方案 > 连接行上的 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>

标签: phprowsconcat

解决方案


完毕。我在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();

推荐阅读