php/msql help?

Agenator

Member
Messages
341
Reaction score
0
Points
16
Hey I have a couple of php questions... Im writing a set of scripts for my friends band and have come accross to problems. First they want to be able to dump the mysql database with all of the users into an excel spreadsheet. I have tried many preexisting scripts but all of them return an error that says "header already updated cannont update headers" I've checked the script for any unwanted characters before the header call is made but have found none so could someone please send me a link to a working mysql db to excel program (it can be in any language supported by X10 (php java cgi etc))?
Also I'm stuck on something really stupid. I want to create a button that when the admin clicks on it a query is run and all of the people in the database are displayed. I have written out the script for the query but I just need to know how to go about linking to the php file using html? Thanks for your help...
 

easykey

New Member
Messages
45
Reaction score
0
Points
0
Sounds like you are nearly there with the first part - just check thoroughly there is no output of any kind before the header call. Don't forget to check 'include' and 'require' files.

For the second part you just need a small html form:

HTML:
<form action="displayUsers.php" method="post">
Click to display users
<input type="submit" name="button" value="Display"/>
</form>

Then your displayUsers.php would be:

PHP:
if ($_POST['button']=="Display"){
   //your SELECT * FROM users query here
   }

I think this is what you are after with some tidying up, otherwise let us know.
 
Top