Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Well I have some code that queries a database and displays all the results in a table, and each result gets its own row (<tr>). Which is because that is what I specified...However, I don't want each result to be on its own row. Lets assume the least amount that can be queried is 3. If x = 3 results are queried, I want it to be displayed using this code
[syntax="html"]<table width="100" border="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>Code: Select all
<table width="100" border="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>Code: Select all
<table width="100" border="0">
<tr>
<td> </td>
<td colspan="2"> </td>
<td> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td colspan="2"> </td>
</tr>
</table>Code: Select all
<?php
$max = 5;
$width = 120;
$content = "<script language='JavaScript' src='tooltip.js'></script>";
$sql = "SELECT memberid, name, realname, birthday, location, country,"
."sex, email, icq, aim, msn, xfire, language, signature, profilehits,"
."status, userid, wartag, picture FROM vwar".$n."_member LIMIT ".$max."";
$result = $db->sql_query($sql);
$content .= "<table width='100%' align='center' border='0'>";
while ($row = $db->sql_fetchrow($result)) {
$content .="<tr><td align='center'><a href='modules.php?name=vwar&file=member&action=profile&memberid=".$row['memberid']."' onMouseOver=\"toolTip('";
$content .="Name: ".$row['name']."<br>";
$content .="Real Name: ".$row['realname']."<br>";
$content .="Birthday: ".$row['birthday']."<br>";
$content .="Location: ".$row['location']."<br>";
$content .="Country: ".$row['country']."<br>";
$content .="Sex: ".$row['sex']."<br>";
$content .="ICQ: ".$row['icq']."<br>";
$content .="AIM: ".$row['aim']."<br>";
$content .="MSN: ".$row['msn']."<br>";
$content .="Xfire: ".$row['xfire']."<br>";
$content .="<b>War Tag:</b> ".$row['wartag']."<br>";
$content .="', ".$width.", 100)\" onMouseOut=\"toolTip()\"><img src='images/blank.gif' border='0' /></a></td></tr>";
}
$content .= "</table>";
echo $content;
?>Thank you
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]