Hello,
I'm very new to PHP (just started messing around with it last night) and I'm trying to create a simple lookup form that takes in a keyword, queries a MySQL database, and returns the data to either a table or some textboxes on the same page. I have it working, but I know it can be cleaner. I have some general questions:
1) Is it better to have one page that creates your HTML output and a separate page to perform the database extracts? If so, how do you send your DB results back to the display page?
2) Should I be putting my database queries in separate scripts? Or create one generic database extract script and pass SQL statements to it?
3) I'm executing a lot of SQL statements, mainly for creating temp tables and inserting data into them. Can I combine these into one statement? Is that even worth it?
Thanks in advance.