I've got this page:
<?php
require_once('scripts/mysql.php');
$qry_cat = "SELECT DISTINCT category FROM companies";
$categories = mysql_query($qry_cat) or die(mysql_error());
?>
<div id="searchead">
<div class="searcheadleft">
<p><a href="#" onmouseover="rollover('button1')" onmouseout="rollout('button1')"><img src="layout/button1.png" name="button1" alt="" height="50" border="0" /></a></p>
<p style="margin-left:2px; margin-top:5px;"></p>
<ul class="menu_class">
<li>
<p><a href="#"><img src="layout/inside/catbut.png" width="158" height="30" alt="" border="0" /></a></p>
</li>
<li>
<ul class="the_menu">
<?php //fetch categories from database
while($row = mysql_fetch_array($categories, MYSQL_ASSOC)) {
printf('<li><a href="companies.php?srtby=%s">%s</a></li>',
$row['category'], $row['category']);
}
?>
</ul>
</li>
</ul>
</div>
<div class="searcheadcenter">
<p style="margin-left:7px;"><img src="layout/logo.png" width="211" height="85" alt="" /></p>
<p style="margin-bottom:15px;"><img src="layout/nocredit.png" width="232" height="19" alt="" /></p>
<p style="margin-left:5px;"><a href="#" onmouseover="rollover('cardbutton')" onmouseout="rollout('cardbutton')"><img src="layout/cardbutton.png" name="cardbutton" width="216" height="60" alt="" border="0" /></a></p>
</div>
<div style="clear:both;"></div>
<div class="searcheadright">
<p><a href="#" onmouseover="rollover('recommend')" onmouseout="rollout('recommend')"><img src="layout/recommend.png" name="recommend" height="30" alt="" border="0" /></a></p>
</div>
</div>
As it is right now, it just prints out categories from a table and makes them links for use in another page where the results are sorted and printed out using $_GET.
The problem is that, as it is right now, I can't use complex category descriptions (with spaces or non-latin characters) as it will mess up the GET request.
Is it possible to have two columns linked in the database, one for the complex category description and one for a simplified description and link those two together or should I just skip that and manually code the links?
So, basically, the while loop prints out category_full_desc which links to companies.php?srtby=companies_desc.