OK, I ask too many questions...
I have modules in development involving MySQL tables. These often involve adding and getting data from these tables. However, I can never get them to work. I try copying from other modules but still nothing.
Submitting Data
Say I wanted to have a user complete a form and submit it. The data would then be inserted to a MySQL table. How does this work? I am aware I will need a module class file for this as well but I'm not sure on the exact code. What would the code be for the submit button to run the function that inserts the data, and what would the PHP function code look like? Is it as simple as the SQL followed by mysql_query($sql); ? (Where $sql contains the SQL code)
Retrieving Data
As for retrieving data, say I wanted an HTML table displaying the content. Sounds easy, but I can never get it to work (although this is probably because I can't get the insert to work). The way I did this is something along the lines of:
$data = ExampleData::getData();
where the function code is nothing more than SQL, but what is the correct code to go after the SQL? Say I have:
$sql = "SELECT * FROM table_name WHERE id=5";
What is the line following it?