getting a mysql database to be searchable and sortable?
<p>Im trying to get my database to be searchable by part of key words, and also sortable by col title in ascending order. However when I put in the code for searchable, I get no return results when I type in a name, and also it has seemed to mess up the sortable code, to where it doesn't want to align correctly in the table, nor want to sort the col title when I click on it?</p>

<p>here is my searchable code:</p>

<pre><code>&lt;?php

$db=mysql_connect("localhost","dispute_admin","xxxxxx");

$mydb=mysql_select_db("dispute_credit");

if(isset($_POST['submit'])){

if(isset($_GET['go'])){

if(preg_match("/[0-9a-zA-Z]+/",$_POST['name'])){

$name=$_POST['name'];

$sql=mysql_query("SELECT * FROM disputes WHERE company LIKE '%$company%', OR account_num LIKE '%$account_num%', OR type LIKE '%$type%'") or die(mysql_error());

$result=mysql_query($sql);

if(isset($_GET['go']))

{

                if($_GET['go']=='company'){

                $sql="SELECT * FROM disputes WHERE company LIKE '%" .$name . "'%";

                }

                elseif

                ($_GET['go']=='account_num'){

                $sql="SELECT * FROM disputes WHERE account_num LIKE '%" .$name . "'%";

                }

                elseif

                ($_GET['go']=='type'){

                $sql="SELECT * FROM disputes WHERE type LIKE '%" .$name . "'%";

                }

}

                WHILE($row=mysql_fetch_array($result)){

                echo 'Company: '.$row['company'];

                echo 'Account Num: '.$row['account_num'];

                echo 'Type: '.$row['type'];



echo "&lt;ol&gt;\n";

echo "&lt;li&gt;" . "&lt;a href=\"disputes.php=$company\"&gt;" . $account_num . " " . $type . " &lt;/a&gt;&lt;/li&gt;\n";

echo "&lt;/ol&gt;";

}

}              

else{

echo "Please enter search words!";

}

}

}

?&gt;
</code></pre>
