Jump to content

Simple but confusing issue!


dooper3

Recommended Posts

I have a simple script to enable administrators to search a MySQL database for a person's surname. The script works fine in Firefox and displays the data as it should, but when you click "search" in IE6, it does not return anything except the search form again.

Below is the code for my search form:

[code]<?
echo ("
    <link type=\"text/css\" rel=\"stylesheet\" href=\"style.css\">
    <form action=\"$php_self\" method=\"post\">
    <table class=\"formtable\" align=\"center\">
    <tr><th colspan=\"2\">Search for a Club Member</th></tr>
    <tr><td><input class=\"form\" name=\"findphrase\"></td><td><input class=\"form\" type=\"submit\" name=\"find\" value=\"search\"></td></tr>
    </table>
    </form>
    ");
if (isset($_POST["find"])) {
    $term = addslashes($_POST["findphrase"]);
    echo ("You searched for \"$term\"<p>");
    include("db_connect.php");
    $sql = mysql_query("SELECT * FROM memberdata WHERE surname LIKE '%$term%'")
        or die ("Could not query the database");
    $num = mysql_numrows($sql);
    if ($num > 0) {
        echo ("Found $num results<p>");
        while ($row = mysql_fetch_array($sql)) {
            extract($row);
            echo ("<a href=\"members.php?choosemember=$uniID\" title=\"$forname $surname\">$forname $surname</a><br>");
        }
        mysql_close();
    } else {
        echo("No results found for that term, please try again");
    }
}
?>[/code]

Any help much appreciated!!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.