What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » MySQL and PHP - using 2 tables in one query?

MySQL and PHP - using 2 tables in one query?
Author: Message:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
31 / Male / Flag
Joined: Jul 2006
O.P. RE: MySQL and PHP - using 2 tables in one query?
Thanks Adeptus, I think I will go away and read some tutorials, so to not fill up this forum with all my MySQL questions xD

However, I am probably doing something really stupid, but this is outputting no results, and I can't figure out why.
PHP code:
<?php echo '<table class="sortable2" id="reports" name="reports">
<tr>
<th><font face="Arial, Helvetica, sans-serif" size="3">SteamID</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">VIP</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">Upgrade 1</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">Upgrade 2</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">Upgrade 3</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">Upgrade 4</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">Upgrade Points</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">Zombie Upgrade Points</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">Bonus Upgrade Points</font></th>
<th><font face="Arial, Helvetica, sans-serif" size="3">Player Model</font></th>
</tr>'
;
?>
 
<?
mysql_connect("xxxxx","xxxxx","xxxx");
mysql_select_db("servers");
$search=$_POST["search"];
$search2 = mysql_real_escape_string($_POST['search']);
$result = mysql_query("SELECT a.*, b.playername
FROM upgrades a INNER JOIN zm_timetracker b ON a.steamid = b.steamid
WHERE b.playername LIKE '%$search2%'"
);
while($r=mysql_fetch_array($result))
{      
   $steam=$r["steamid"];
   $dt=$r["vip"];
   $pn=$r["playerupgrade1"];
   $rs=$r["playerupgrade2"];
   $rp=$r["playerupgrade3"];
   $se=$r["playerupgrade4"];
   $sns=$r["upgradepoints"];
   $snr=$r["zombieupgradepoints"];
   $snp=$r["bonusupgradepoints"];
   $sn=$r["playermodel"];
   
   echo "<tr><td>$steam</td><td>$dt</td><td>$pn</td><td>$rs</td><td>$rp</td><td>$se</td><td>$sns</td><td>$snr</td><td>$snp</td></tr>";
}
 
?>
</table>
 

I get no PHP errors, so I assume the syntax is all OK.

This post was edited on 01-17-2010 at 07:33 PM by Jimbo.
01-17-2010 07:33 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-17-2010 at 01:32 AM
RE: MySQL and PHP - using 2 tables in one query? - by MeEtc on 01-17-2010 at 03:05 AM
RE: MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-17-2010 at 01:51 PM
RE: MySQL and PHP - using 2 tables in one query? - by stoshrocket on 01-17-2010 at 04:41 PM
RE: MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-17-2010 at 04:48 PM
RE: MySQL and PHP - using 2 tables in one query? - by stoshrocket on 01-17-2010 at 05:23 PM
RE: MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-17-2010 at 05:33 PM
RE: MySQL and PHP - using 2 tables in one query? - by Adeptus on 01-17-2010 at 07:24 PM
RE: MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-17-2010 at 07:33 PM
RE: MySQL and PHP - using 2 tables in one query? - by Chrissy on 01-17-2010 at 07:55 PM
RE: MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-17-2010 at 07:57 PM
RE: MySQL and PHP - using 2 tables in one query? - by Chrissy on 01-17-2010 at 08:04 PM
RE: MySQL and PHP - using 2 tables in one query? - by Adeptus on 01-17-2010 at 08:13 PM
RE: MySQL and PHP - using 2 tables in one query? - by MeEtc on 01-17-2010 at 08:15 PM
RE: MySQL and PHP - using 2 tables in one query? - by Matti on 01-17-2010 at 08:19 PM
RE: MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-17-2010 at 08:39 PM
RE: MySQL and PHP - using 2 tables in one query? - by Adeptus on 01-17-2010 at 08:55 PM
RE: MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-17-2010 at 09:16 PM
RE: MySQL and PHP - using 2 tables in one query? - by Adeptus on 01-17-2010 at 09:22 PM
RE: MySQL and PHP - using 2 tables in one query? - by NanaFreak on 01-18-2010 at 01:49 AM
RE: MySQL and PHP - using 2 tables in one query? - by Jimbo on 01-18-2010 at 01:44 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On