SkyRanger Posted April 22, 2007 Share Posted April 22, 2007 Ok, I am stuck on something. Here is the problem I am having. User clicks on link: viewlatest?oid=$oid it reads the table office_posts for latest oid table layouts are as follows: office_posts oid omid omsg users id member What I need it to do is read the 2 tables, and display omsg and member name when omid = id Here is what I have so far: $resultopv = mysql_query( "SELECT users.*, office_posts.* ". "FROM users, office_posts ". "where oid='$oid' and omid = '$id' ORDER BY `oid` DESC limit 0 , 1") or die(mysql_error()); $wordnum = mysql_num_rows( $resultopv ); while( $rowopv = mysql_fetch_array( $resultopv ) ) { $latpt = $rowopv['omsg']; $latmr = $rowopv['member']; } I know there is something wrong with that code, just not sure what it is. Link to comment https://forums.phpfreaks.com/topic/48145-solved-grab-info-from-mulitple-tables/ Share on other sites More sharing options...
SkyRanger Posted April 22, 2007 Author Share Posted April 22, 2007 ~bump~ Link to comment https://forums.phpfreaks.com/topic/48145-solved-grab-info-from-mulitple-tables/#findComment-235347 Share on other sites More sharing options...
SkyRanger Posted April 22, 2007 Author Share Posted April 22, 2007 Nevermind, fixed it myself. have to learn to double check my tables for proper names Link to comment https://forums.phpfreaks.com/topic/48145-solved-grab-info-from-mulitple-tables/#findComment-235357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.