Jump to content

a "WHERE" problem that I simply don't know how to do


xwishmasterx

Recommended Posts

I am trying to do a query for members in my database but I need to go through different tables to get those members I want. Let me try too describe:

 

I want the members who has same team_id as current member (from same table)

I want only the members who are online (from another table where time stamps are, which has members id, but not team id)

 

I simply cannot figure out how to only get members with same team id as the current member, from the table with time stamps.

 

Anyone can point me in the right direction, or is the above just not making sense at all?

 

 

Link to comment
Share on other sites

I think I found a way to add the team_id to the tracking table, but cannot seem to get it just right. Found this piece of code:

 

 //Add to Tracking
	      $remote_ip = $_SERVER[REMOTE_ADDR];
	      $UPD_SQL = "INSERT INTO vtp_tracking(credit_members_id,debit_members_id,url_id,action_date,remote_ip,teamid)
	        VALUES('$members_id','$url_members_id','$url_id', NOW() , '$remote_ip' );";

 

So I added a column in above table named teamid (added this to above code also).

 

how can I add the result of this query to the above code VALUES?:

 

$sql= "SELECT team_id FROM vtp_members WHERE id=$members_id";
  $result = mysql_fetch_array( $sql );

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.