Posted: Tue Jan 02, 2007 1:29 am
Ok, im going to head this towards a different route. Im using this code
to search the member table, called loginphp, for all the Uname (user names) that have the guild SLX in the guild field, matching my session guild, which is slx, and set when i log in. I know the session is set correctly because i use this same thing in some code above it, but for some reason, i get no table showing up on the site, it just says Username Character Name, but no data or table, which means my query must not be working correctly for some reason, anyone see anything wrong? i dont get it, because i have a query almost exactly like it
which works perfectly fine.
Code: Select all
if($_GET['action'] == 'members')
{
$result = mysql_query("SELECT Uname FROM `loginphp` WHERE `Guild` = '{$_SESSION['Guild']}'") or die(mysql_error());
echo "<center>";
echo "<table><tr><td><b>Username</b></td><td><b>Character Name</b></td></tr>";
if($_GET['action'] == '')
{
header("Location:?action=nextpage&id=1");
}
if($_GET['action'] == 'nextpage')
{
// Print out the contents of the entry
$num=mysql_numrows($result);
$strBGColor = '#EAF1FF';
$i=0;
while ($i < $num)
{
$number = $number + 1;
$number2 = 25;
$id = $_GET['id'] + 1;
$id3 = $_GET['id'] - 1;
$id2 = $_GET['id']*$number2;
if($number < (($id3*$number2)+1) || $number > $_GET['id']*$number2)
{
$row = mysql_fetch_array( $result );
$i++;
$number4 = $number;
}
else
{
if($strBGColor == '#EAF1FF')
{
$strBGColor = '#8ab4ff';
}
else
{
$strBGColor = '#EAF1FF';
}
$row = mysql_fetch_array( $result );
echo "<tr bgcolor='$strBGColor'><td>";
echo "" . $row['Uname'] . "</td><td>";
echo "" . $row['Cname1'] . "</td></tr>";
$i++;
$username = $row['Uname'];
}
}
}
echo "</table>";
$next = $_GET['id'] + 1;
$back = $_GET['id'] - 1;
if($_GET['id'] == '1')
{
echo "<a href=?action=nextpage&id=$next>next</a>";
}
if($_GET['id'] > '1')
{
if($_GET['id'] < ($number4/$number2))
{
echo "<a href=?action=nextpage&id=$back>back</a> | <a href=?action=nextpage&id=$next>next</a>";
}
else
{
echo "<a href=?action=nextpage&id=$back>back</a>";
}
}
if($username == '')
{
echo "<a href=?action=nextpage&id=$back>back</a>";
}
}Code: Select all
"SELECT * FROM `guilds` WHERE `Tag` = '{$_SESSION['Guild']}'"