0) { /* By changing Fred below to another specific persons name you can limit access to just the part of the database for that individual. You could eliminate WHERE recorder_id='Fred' all together if you want to give full access to everyone. */ $values = mysqli_query($dbc, "SELECT * FROM customer WHERE recorder_id='Fred'"); while ($rowr = mysqli_fetch_row($values)) { for ($j=0;$j<$numberOfRows;$j++) { $csv_output .= $rowr[$j].", "; } $csv_output .= "\n"; } } print $csv_output; exit; ?>