Question: I am a new user of php. 

I have one table in mysql database. I have a form which the users use to query the mysql database. I am testing my html form page on my linux laptop which has APACHE server. 

I am able to make a connection to the mysql database and display results in the browser.

I am not sure how to capture the results from the variable which has query results which has several rows of data and be able to write the results to a text file in /var/www/

Thank you

Answer: 
I noticed every time you check if the POST variable is set you use something like

```
if(isset($POST["submit"])){

```

Was that a typo in this post or are you forgetting the underscore?

```
if(isset($_POST["submit"])){

```
Also try to use mysql\_fetch\_assoc instead of mysql\_fetch\_array.
And always prepare the variabes for usage in a query if you do not want to get hacked instantly.