MySQL and working with two tables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tarja311
Forum Commoner
Posts: 73
Joined: Fri Oct 20, 2006 10:57 pm

MySQL and working with two tables

Post by tarja311 »

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 :

Code: Select all

echo "<TD><A HREF = '?show=management&cmd=moderate&id=$id'>Set as Moderator</A>";
... where $id is the index id of that user.

Above that code is a :

Code: Select all

if(!isset($cmd))
{
and below is the empty execute command :

Code: Select all

if($cmd == "private")	
{	}
I hope i am making it clear enough to understand.

Thanks

-- tarja
tarja311
Forum Commoner
Posts: 73
Joined: Fri Oct 20, 2006 10:57 pm

Post by tarja311 »

I resolved it.

Thanks. :)
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

tarja311 wrote:I resolved it.

Thanks. :)
Glad you resolved it. Do us all a favor and go back to your original post and amend the Subject line to include the word RESOLVED or FIXED. That saves us time from trying to help you when you've already solved it. Thanks.
Post Reply