Zigaform Εξαγωγή υποβολών απευθείας από την βάση δεδομένων

Κοινοποιήστε

Ένα σκριπτάκι σε php για να κάνετε export τις εγγραφές απευθείας από την βάση δεδομένων, by me 😉

<?php $sqlHost = 'localhost'; $sqlUser = 'USERNAME'; $sqlPass = 'PASSWORD'; $database = 'DATABASE'; $conn = new mysqli($sqlHost, $sqlUser, $sqlPass, $database); if($conn->connect_errno){
    printf(&quot;Connect failed: %s\n&quot;, $conn->connect_error);
    exit();
}
$sql = &quot;SELECT `fbh_data_rec_xml` FROM `fbcf_uiform_form_records`&quot;;
$result = mysqli_query($conn, $sql); // First parameter is just return of &quot;mysqli_connect()&quot; function
echo &quot;
&quot;;
echo &quot;

<table border='1'>&quot;;
while ($row = mysqli_fetch_assoc($result)) { // Important line !!! Check summary get row on array ..
    echo &quot;

<tr>&quot;;
    foreach ($row as $field => $value) { // I you want you can right this line like this: foreach($row as $value) {
        echo &quot;

<td>&quot; . $value . &quot;</td>


&quot;; // I just did not use &quot;htmlspecialchars()&quot; function.
    }
    echo &quot;</tr>


&quot;;
}
echo &quot;</table>


&quot;;
?>