Alicia Posted March 17, 2009 Share Posted March 17, 2009 Hi, I am trying to join 2 tables and select the info I want but it doesnt seem to work.. can somebody please advise on my code : $result = @mysql_query("SELECT * FROM profile,vrequest WHERE profile.id=vrequest.by, profile.type = Student AND vrequest.status= Accepted AND vrequest.to=$vID"); What i want is actually output the information from profile table where it meets the condition that type of students, status and 'to' value as given... all other tables are storing the ID only and the full info is in profile table.. Tried this as well but not working too. $result = @mysql_query("SELECT * FROM profile,vrequest WHERE profile.type = 'Student' AND vrequest.status= 'Accepted' AND vrequest.to='$vID'"); Please advise Quote Link to comment https://forums.phpfreaks.com/topic/149762-info-not-displayed/ Share on other sites More sharing options...
Zane Posted March 17, 2009 Share Posted March 17, 2009 post your table layout Quote Link to comment https://forums.phpfreaks.com/topic/149762-info-not-displayed/#findComment-786425 Share on other sites More sharing options...
Alicia Posted March 17, 2009 Author Share Posted March 17, 2009 vrequest structure rid int(10) No auto_increment by varchar(5) latin1_swedish_ci No to varchar(5) latin1_swedish_ci No status varchar(5) latin1_swedish_ci No type varchar(5) latin1_swedish_ci No profile mid int(5) No auto_increment id varchar(5) latin1_swedish_ci No pro longtext latin1_swedish_ci No resume mediumtext latin1_swedish_ci No type varchar(100) latin1_swedish_ci No date timestamp ON UPDATE CURRENT_TIMESTAMP No CURRENT_TIMESTAMP info varchar(200) latin1_swedish_ci No status varchar(20) latin1_swedish_ci No Active * Type and status for both tables are having different info.. only the vrequest to and by column value which used to store ID needs to refer back to profile table id to get the other information. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/149762-info-not-displayed/#findComment-786433 Share on other sites More sharing options...
fenway Posted March 17, 2009 Share Posted March 17, 2009 Since you're supressing errors, we're not going to get very far. Quote Link to comment https://forums.phpfreaks.com/topic/149762-info-not-displayed/#findComment-786669 Share on other sites More sharing options...
Alicia Posted March 17, 2009 Author Share Posted March 17, 2009 what do you mean? there is no error displayed in my page even I used mysql_error() please advise. Quote Link to comment https://forums.phpfreaks.com/topic/149762-info-not-displayed/#findComment-786735 Share on other sites More sharing options...
fenway Posted March 17, 2009 Share Posted March 17, 2009 The "@" suppresses errors.... Quote Link to comment https://forums.phpfreaks.com/topic/149762-info-not-displayed/#findComment-786994 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.