My Blog
Zigaform Export records directly from database
- November 27, 2019
- -
- nicolas
Heres a simple php script to export records directly from database, as always by Nicolas 😉
<?php $sqlHost = 'localhost'; $sqlUser = 'USERNAME'; $sqlPass = 'PASSWORD'; $database = 'DATABASE'; $conn = new mysqli($sqlHost, $sqlUser, $sqlPass, $database); if($conn->connect_errno){ printf("Connect failed: %sn", $conn->connect_error); exit(); } $sql = "SELECT `fbh_data_rec_xml` FROM `fbcf_uiform_form_records`"; $result = mysqli_query($conn, $sql); // First parameter is just return of "mysqli_connect()" function echo " "; echo " <table border='1'>"; while ($row = mysqli_fetch_assoc($result)) { // Important line !!! Check summary get row on array .. echo " <tr>"; foreach ($row as $field => $value) { // I you want you can right this line like this: foreach($row as $value) { echo " <td>" . $value . "</td> "; // I just did not use "htmlspecialchars()" function. } echo "</tr> "; } echo "</table> "; ?>
This post is also available in: Ελληνικά