PHP and SQL Social Operations

Mousey

New Member
I've got a table created using this query.\[code\]CREATE TABLE `tbl_friends` ( `friend_id` int(11) NOT NULL auto_increment, `friend_status` tinyint(4) NOT NULL default '0', `friend_id1` int(11) NOT NULL default '0', `friend_id2` int(11) NOT NULL default '0', `friend_date` datetime NOT NULL default '0000-00-00 00:00:00', `friend_confirm` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`friend_id`)) TYPE=MyISAM AUTO_INCREMENT=10 ;\[/code\]I want to view the list of my friends, for that I only need to know other user's id - numeric value stored in friend_id1 or friend_id2 rows. My problem is that I don't know if friend_id1 or friend_id2 contains required data.Please help me create a query to receive the number of another user if my number is $_SESSION['id']
 
Back
Top