HELP!
I am creating a member search page for my social network. i have an error and nothing is showing up in my search results.
Here is my url http://www.hcrindienetwork.com/member_search.php
Here is the page code:
<?php
// Connect to database
include_once "free/connect_to_mysql.php";
// DEAFAULT QUERY STRING
$queryString = "WHERE emailactivated='1' ORDER BY id ASC";
// DEFAULT MESSAGE ON TOP OF RESULT DISPLAY
$queryMsg = "Showing Senior to Newest members by Default";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////// SET UP FOR SEARCH CRITERIA QUERY SWITCH MECHANISMS
if (($_POST['listByq'] == "newestmembers")) {
$queryString = "WHERE emailactivated='1' ORDER BY id DESC";
$queryMsg = "Showing Newest to Oldest Members";
} else if ($_POST['listByq'] == "by_username") {
$uname = $_POST['uname'];
$uname = stripslashes($uname);
$uname = strip_tags($uname);
$uname = eregi_replace("`", "", $uname);
$uname = mysql_real_escape_string($uname);
$queryString = "WHERE username LIKE '%$uname%' AND emailactivated='1'";
$queryMsg = "Showing members with the name you searched for";
}
/////////////// END SET UP FOR SEARCH CRITERIA QUERY SWITCH MECHANISMS
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////// QUERY THE MEMBER DATA USING THE $queryString variable's value
$sql = mysql_query("SELECT id, username, country, FROM members $queryString");
//////////////////////////////////// Pagination Setup ////////////////////////////////////
// Build the Output Section Here
$outputList = '';
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
$username = $row["username"];
$country = $row["country"];
/////// Mechanism to Display Pic. See if they have uploaded a pic or not //////////////////////////
$check_pic = "memberFiles/$id/pic1.jpg";
$default_pic = "memberFiles/0/pic1.jpg";
if (file_exists($check_pic)) {
$user_pic = "<img src=\"$check_pic\" width=\"120px\" border=\"0\" />"; // forces picture to be 120px wide and no more
} else {
$user_pic = "<img src=\"$default_pic\" width=\"120px\" border=\"0\" />"; // forces default picture to be 120px wide and no more
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$outputList .= '
<table width="100%">
<tr>
<td width="23%" rowspan="3"><div style=" height:120px; overflow:hidden;"><a href="http://www.hcrindienetwork/free/member_profile.php?id=' . $id . '" target="_blank">' . $user_pic . '</a></div></td>
<td width="14%" class="style7"><div align="right">Name:</div></td>
<td width="63%"><a href="http://www.hcrindienetwork.com/free/profile.php?id=' . $id . '" target="_blank">' . $username . '</a> </td>
</tr>
<tr>
<td class="style7"><div align="right">Country:</div></td>
<td>' . $country . ' </td>
</tr>
<tr>
<td class="style7"><div align="right">Website:</div></td>
<td> </td>
</tr>
</table>
<hr />
';
} // close while //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////// END QUERY THE MEMBER DATA & Build the Output Section ////////////////////////////
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Description" content="Page Description goes here" />
<meta name="Keywords" content="Page Keywords go here" />
<meta name="rating" content="General" />
<meta name="revisit-after" content="7 days" />
<meta name="ROBOTS" content="All" />
<title>Browse Members</title>
</head>
<body>
<table width="950" align="center">
<tr>
<td width="758" valign="top"><br />
<table width="94%" align="center" cellpadding="6">
<tr>
<td bgcolor="#E9E9E9"><form id="form1" name="form1" method="post" action="member_search.php">
Browse Newest Members
<input name="button" type="submit" id="button" value="Go" />
<input type="hidden" name="listByq" value="newestmembers" />
<td bgcolor="#E9E9E9"><form id="form3" name="form3" method="post" action="member_search.php">
Search By Band Name
<input type="text" name="uname" id="uname" />
<input name="button3" type="submit" id="button3" value="Go" />
<input type="hidden" name="listByq" value="by_username" />
</form></td>
</tr>
</table>
<br />
<table width="70%" align="center" cellpadding="6">
<tr>
<td><?php print "$queryMsg"; ?><br /><br />
<?php print "$outputList"; ?></td>
</tr>
</table>
<br />
<br /></td>
<td width="180" valign="top"></td>
</tr>
</table>
</body>
</html>