PDA

View Full Version : Need help getting data to display on button click



brickout
03 Aug 2010, 05:11 PM
Hey guys,

I've written some code which retrieves and echoes a random line of data from a table in mysql. I'd like for this data to be displayed after a user clicks a "Retrieve Data' button or something like that. This sounds like it would be simple enough to do, thing is I'm new to web developing and never really used buttons before.

As far as I understand I need to use
<form> <input name="whatever" type="submit" value="whatever"/> </form>

I'm not sure where I would put my php code though or how this all works.

I'd really appreciate if anyone can help me out.

Thanks!!