I've been trying to play with join commands and such and I've had no luck.
I'm using the following code:
$q = mysql_query("SELECT a.id,a.name,a.button, a_s.show_num,a_s.sort_by,a_s.sort_order,a_s.show_link from affiliates a,affiliates_settings a_s ORDER BY a_s.sort_by a_s.sort_order LIMIT a_s.show_num");
while ($d = mysql_fetch_array($q))
{
?>
<tr>
<td>
<table width="83%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="absmiddle" onMouseOver="mOver('<? echo($css) ?>',this,'[Quality Sites] - Visit <? echo($d[1]) ?>.')" onMouseOut="mOut(this)" class="navbutton">
<a href="affiliates.php?id=<? echo($d[0]) ?>" target="new"><img width="88" height="31" src="images/affiliates/<? echo($d[2]) ?>" border="0" alt="Visit <? echo($d[1]) ?>"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<?
}
But it gives me an error; Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\web\html\v3\libs\layout.lib.php on line 927
Any idea?