Jump to content

Info not displayed


Alicia

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/149762-info-not-displayed/
Share on other sites

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

 

Link to comment
https://forums.phpfreaks.com/topic/149762-info-not-displayed/#findComment-786433
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.