this example is not working
this example is not working
<form action="export.php" method="post" name="export_excel"> <div class="control-group"> <div class="controls"> <button type="submit" id="export" name="export" class="btn btn-primary button-loading" data-loading-text="Loading...">Export MySQL Data to CSV/Excel File</button> </div> </div> </form>
<?php include 'db.php'; $SQL = "SELECT * from subject"; $header = ''; $result =''; for ( $i = 0; $i < $fields; $i++ ) { } { $line = ''; foreach( $row as $value ) { { $value = "\t"; } else { $value = '"' . $value . '"' . "\t"; } $line .= $value; } } if ( $result == "" ) { $result = "\nNo Record(s) Found!\n"; } print "$header\n$result"; ?>
when i use this codes for my website it download all the page content including table data
but i export only table data.