Hi,
I have been trying to get my head around joining tables in mysql and getting data from two tables depending on unique id. What I am trying to do is:
I have one table called "users" that contains all the account info of users (20 fields) and each row has a unique id. I have a second table called "notes" which has one fulltext field for notes to be added and a timestamp field.
I want to be able to add notes against a user's account by clicking a link next to their unique id, pulling up a form for adding notes & viewing previous notes against that user. The updated notes then are added to the "notes" db with the timestamp and can be viewed by a link next to their unique id in my admin section called "view/add notes".
I have selected from the "users" db and viewed them in rows, with a link next to each "Add/View Notes" pointing to notes.php?id=$id which doesn't work. I have tried using: $id = $_GET['id'];
$query = "SELECT FROM data WHERE id = '$id'";
... to call the correct user's id, but I know I'm missing something.
How do I call the href to notes.php to display that update notes form with the unique id of the user in "users" db, and view all previous notes against that user, without the notes mixing together, and without muddling the different user's notes up? How do I join the db's correctly to do what I want?
I hope this makes sense - it's confusing the heck outta me!
TIA
Jonathen