Thanks, I have updated that. I have also changed from a search box to a dropdown with the choices to save space, but I'm not sure I'm happy with that... but it's working for now...
Last thing I would like to be able to do is sort the results alphabetically before they are spit out. If my code is the following, can I put a sort in there somewhere, so it sorts the Name?
Code:
if ($choice == "all")
{
echo "<B>This is a full listing of the email database</B>";
$result = mysql_query("SELECT * FROM evolinks");
};
if ($choice == "request")
{
echo "<B>All Selected Emails</B>";
$result =
mysql_query("SELECT * FROM evolinks
WHERE Branch LIKE \"%$search%\" AND (Mailgroup LIKE \"%$search2%\" OR Mailgroup LIKE 'B')");
};
echo "<script type='text/javascript'>";
echo "var students=[];";
if ($myrow = @mysql_fetch_array($result)) {
do
{
echo "students[students.length]=['",$myrow["Name"],"', '",$myrow["email"],"'];";
} while ($myrow = @mysql_fetch_array($result));
echo "</script>";
}
Bookmarks