Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to make values on table ascend or descend
    primarykey
    data
    text
    <p>I currently have a table on my site but I need there to be a icon or something next to the text on the categories in the table to make the values ascend alphabetically, I have no idea how to do this and I have looked.</p> <p><img src="https://i.stack.imgur.com/Pyu1G.jpg" alt="enter image description here"></p> <p>Here is my code- (Yes I know its insecure w/ mysql_connect)</p> <pre><code>&lt;?php $username="dfgdfg"; $password="dfgdfg"; $database="dfg"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); if (isset($_POST['search'])) { $columbname = $_POST['selectitem']; $searchterm = $_POST['searchterm']; $query="SELECT * FROM transactions WHERE agentclient = '$agentclient' AND $columbname LIKE '%$searchterm%'"; $result = mysql_query ($query) or die(mysql_error()); } else { $query="SELECT * FROM transactions WHERE agentclient = '$agentclient'"; $result = mysql_query ($query) or die(mysql_error()); } $num=mysql_numrows($result); mysql_close(); ?&gt; &lt;table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"&gt; &lt;tr valign="bottom" bgcolor="#000000"&gt; &lt;td width="24"&gt;&lt;span class="style1b"&gt;&lt;strong&gt;No.&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="105"&gt;&lt;span class="style1b"&gt;&lt;strong&gt;Date&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;!--&lt;td width="57"&gt;&lt;span class="style1b"&gt;&lt;strong&gt;Agent/client&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;--&gt; &lt;td width="120"&gt;&lt;span class="style1b"&gt;&lt;strong&gt;Property/Description&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="199"&gt;&lt;span class="style1b"&gt;&lt;strong&gt;Transaction type &lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="235"&gt;&lt;span class="style1b"&gt;&lt;strong&gt;Applicable document &lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="58"&gt;&lt;span class="style1b"&gt;&lt;strong&gt;Received&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;td width="58"&gt;&lt;span class="style1b"&gt;&lt;strong&gt;Paid&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php $i=0; while ($i &lt; $num) { $f1=mysql_result($result,$i,"id"); $f2=mysql_result($result,$i,"date"); //$f3=mysql_result($result,$i,"agentclientt"); $f4=mysql_result($result,$i,"propertydescription"); $f5=mysql_result($result,$i,"transactiontype"); $f6=mysql_result($result,$i,"applicabledocument"); $f7=mysql_result($result,$i,"received"); $f8=mysql_result($result,$i,"paid"); ?&gt; &lt;tr valign="top" bgcolor="#FFFFFF"&gt; &lt;td&gt;&lt;?php echo $f1; ?&gt;&lt;/td&gt; &lt;!--id--&gt; &lt;td&gt;&lt;?php echo $f2; ?&gt;&lt;/td&gt; &lt;!--date--&gt; &lt;!-- &lt;td&gt;&lt;?php //echo $f3; ?&gt;&lt;/td&gt; --&gt;&lt;!--agent/client--&gt; &lt;td&gt;&lt;?php echo $f4; ?&gt;&lt;/td&gt; &lt;!--desc--&gt; &lt;td&gt;&lt;?php echo $f5; ?&gt;&lt;/td&gt; &lt;!--type--&gt; &lt;td&gt;&lt;a href="/manage/clientdoc/&lt;?php echo $f6; ?&gt;"&gt;&lt;?php echo $f6; ?&gt;&lt;/a&gt;&lt;/td&gt; &lt;!--document--&gt; &lt;td&gt;&lt;?php echo $f7; ?&gt;&lt;/td&gt; &lt;!--recived--&gt; &lt;td&gt;&lt;?php echo $f8; ?&gt;&lt;/td&gt; &lt;!--paid--&gt; &lt;/tr&gt; &lt;?php $i++; } ?&gt; &lt;/table&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload