trying to build a member search page for my social network. check out this error and tell me what im doing wrong 🙁
here is the page
http://harborcityrecords.com/hcrindienetwork/free/member_search.php
here is the page code
<?php
// Connect to database
include_once "connect_to_mysql.php";
// DEAFAULT QUERY STRING
$queryString = "WHERE email_activated='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'] == "newest_members")) {
$queryString = "WHERE email_activated='1' ORDER BY id DESC";
$queryMsg = "Showing Newest to Oldest Members";
} else if ($_POST['listByq'] == "by_username") {
$fname = $_POST['fname'];
$fname = stripslashes($fname);
$fname = strip_tags($fname);
$fname = eregi_replace("`", "", $fname);
$fname = mysql_real_escape_string($fname);
$queryString = "WHERE username LIKE '%$fname%' AND email_activated='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, lastname, country, website FROM myMembers $queryString");
//////////////////////////////////// Pagination Setup ////////////////////////////////////
// Build the Output Section Here
$outputList = '';
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
$username = $row["username"];
$lastname = $row["lastname"];
$country = $row["country"];
$website = $row["website"];
/////// 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.com/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/member_profile.php?id=' . $id . '" target="_blank">' . $username . ' ' . $lastname . '</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><a href="http://' . $website . '" target="_blank">' . $website . '</a> </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>
<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="newest_members" />
</form> </td>
<td bgcolor="#E9E9E9"><form id="form2" name="form2" method="post" action="member_search.php">
Browse YouTube Members
<input name="button2" type="submit" id="button2" value="Go" />
<input type="hidden" name="listByq" value="yt_members" />
</form></td>
<td bgcolor="#E9E9E9"><form id="form3" name="form3" method="post" action="member_search.php">
Search By Name
<input type="text" name="fname" id="fname" />
<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>
</tr>
</table>
</body>
</html>