Don't laugh! I'm sure this is very simple for many people, but if you can help I would be so greatful!
I've create a SQL database which contains two tables.
1 table holds user information (usernames, passwords, emails)
The other table I want to hold text inputs from the user (they will go to a page and enter text, this will then be held in the database and referanced to their username for access later)
I've got the user registration and logins working really well, however I am now stuck on the text input part. Can I "include" more that one table in a page when I do my INSERT, or am I going about this the wrong way?
I need to edit both tables at the same time. Is this possible?
As for the INSERT, you need to excute it record-by-record, so to speak, if there are 3 records to be put into the database for the user "foo", then you have to have 3 separate SQL statements (i.e. INSERT):
The same holds true for UPDATE statements. If you need to update 2 tables "at the same time", you run sepatrate queries sequentially. The only time you can automatically update more than 1 separate tables that I can think of is when you impose foreign key constraint CASCADE ON UPDATE, but this will only update your key(s) and not the other values.
If you insist you can look into transaction. With transaction, you can excute multiple SQL statements as if they were one SQL statement (rollback upon failure). BUT if you're dealing with only two tables and they are not auto-numbered, I guess it'd be an overkill. More info here: http://dev.mysql.com/doc/mysql/en/In...ion_model.html