shorty3 Posted August 23, 2010 Share Posted August 23, 2010 right i did this code <table width="400" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#000000" class=thinline> <tr class="header" background="includes/grad.jpg"> <td height="20" colspan="3" background="includes/grad.jpg" class=header><div align="center" class="header">Last 10 Kills</div></td> </tr> <tr class="header" background="includes/grad.jpg"> <td width="166" height="20" background="includes/gradgrey.jpg">Name</td> <td width="157" height="20" background="includes/gradgrey.jpg">Rank</td> <td width="157" height="20" background="includes/gradgrey.jpg">Killed Time</td> </tr> <? $c=mysql_query("SELECT * FROM attempts WHERE outcome='Dead' ORDER BY id DESC LIMIT 10"); while($d=mysql_fetch_object($c)){ echo "<tr><td><a href='profile.php?viewuser=$d->target'>$d->target</a></td><td>$d->rank</td><td>$d->date</td></tr>"; } ?> but you see the $d->rank is in another database called users How can i link the databases so the last 10 kills shows the users rank Quote Link to comment https://forums.phpfreaks.com/topic/211529-linking-databases-to-get-info/ Share on other sites More sharing options...
trq Posted August 24, 2010 Share Posted August 24, 2010 Do you mean to say 'table' instead of 'database'? Quote Link to comment https://forums.phpfreaks.com/topic/211529-linking-databases-to-get-info/#findComment-1103002 Share on other sites More sharing options...
pengu Posted August 24, 2010 Share Posted August 24, 2010 Do you mean to say 'table' instead of 'database'? Assuming he did mean this a INNER JOIN or LEFT JOIN would be the SQL to use. http://www.w3schools.com/sql/sql_join_inner.asp - etc etc Quote Link to comment https://forums.phpfreaks.com/topic/211529-linking-databases-to-get-info/#findComment-1103004 Share on other sites More sharing options...
shorty3 Posted August 24, 2010 Author Share Posted August 24, 2010 this seems amazingly helpful thank you ill let you no if it works ok Quote Link to comment https://forums.phpfreaks.com/topic/211529-linking-databases-to-get-info/#findComment-1103008 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.