I've the following script:
<?php
mysql_connect (localhost, user, password);
mysql_select_db (db);
$result = mysql_query ("SELECT * FROM $usertable
WHERE benaming LIKE '%$benaming%' AND locatie = '$plaats'
");
if ($row = mysql_fetch_array($result)) {
do {
print ("<tr><td>");
print ("<a href=\"http://www.cmo-mechelen.be/detail.php?id=$row[id]\" class=frontlinkred2>");
print $row["benaming"];
print ("</a>.");
print ("</td>");
print ("<td>");
print ("<div class=fronttext>");
list($year, $month, $day) = explode("-", $row["startdatum"]);
echo $day;
print ("/");
echo $month;
print ("/");
echo $year;
print ("</div>");
print ("</td>");
print ("<td>");
print ("<div class=fronttext>");
print $row["locatie"];
print ("</div>");
print ("</td>");
} while($row = mysql_fetch_array($result));
} else {print "<b>Sorry, geen records gevonden! Probeer het opnieuw met een ander trefwoord of surf per categorie.</b><br><br>";}
?>
now depending on what a users chooses for $usertable
I want to change the url in the print part of the script
if $usertable=lang it's detail2.php in the url
if $usertable=kort it's detail.php in the url
hoe does one do this without screwing up this scritp and it's performance?
any help will be greatly appreciated, thanks in advance