MySQL and working with two tables
Posted: Sun Dec 24, 2006 7:47 pm
Hey guys,
I have a PHP script communicating to MySQL. Two tables are used and are set up as follows :
ID | User-ID
and
ID | Moderator
The first table is basically a logging table that logs incoming users by inserting the users id into the User-ID column. The second table is where the admins can set users to become moderators.
The way it is all laid out is like this : The admins have access to a user-management page where there is a hyper-link next to each user-id ( using the first table ) that says "Set as Moderator". When this link is clicked, it automatically sets that user as moderator by adding their user-id into the second table. Unfortunately i haven't gotten that far. I can't seem to get that user-id variable into the other table, just the index id ( 1, 2, 3 ... ect )
The "Set as Moderator" link looks like this :
... where $id is the index id of that user.
Above that code is a :
and below is the empty execute command :
I hope i am making it clear enough to understand.
Thanks
-- tarja
I have a PHP script communicating to MySQL. Two tables are used and are set up as follows :
ID | User-ID
and
ID | Moderator
The first table is basically a logging table that logs incoming users by inserting the users id into the User-ID column. The second table is where the admins can set users to become moderators.
The way it is all laid out is like this : The admins have access to a user-management page where there is a hyper-link next to each user-id ( using the first table ) that says "Set as Moderator". When this link is clicked, it automatically sets that user as moderator by adding their user-id into the second table. Unfortunately i haven't gotten that far. I can't seem to get that user-id variable into the other table, just the index id ( 1, 2, 3 ... ect )
The "Set as Moderator" link looks like this :
Code: Select all
echo "<TD><A HREF = '?show=management&cmd=moderate&id=$id'>Set as Moderator</A>";Above that code is a :
Code: Select all
if(!isset($cmd))
{Code: Select all
if($cmd == "private")
{ }Thanks
-- tarja