Hi everyone I am trying to use sql_regcase and well it seems not to be playing nice.
I have the following code I am trying to do a case sensitive search on filename. What am I doing wrong???
<?php
$dbcnx = @mysql_connect("localhost", "ya", "right");
mysql_select_db('test');
$select = "Select id, date, case_num, name, filename, filelocation";
$from = " From d";
$where = " Where id > 0";
$order = " Order by date DESC";
$limit = " Limit $limit";
if ($name != "") {
$where .= " and name='$name'";
}
if ($date != "") {
$where .= " and date='$date'";
}
if ($filename != "") {
$filename = sql_regcase('$filename');
$where .= " and filename LIKE '%$filename%'";
}
<TABLE width="100%"BORDER="1">
<TR>
<TH><font color="#0000CC"><b>Date</b></font></TH>
<TH><font color="#0000CC"><b>Case Number</b></font></th>
<th><font color="#0000CC"><b>Case Name</b></font></TH>
</TR>
<?php
$result = mysql_query($select . $from . $where . $order . $limit);
if (!$result) {
echo("</TABLE>");
echo("<P>Error retrieving employee's from database!<BR>".
"Error: " . mysql_error());
exit();
}
$number=mysql_numrows($result);
while ($r = mysql_fetch_array($result)) {
echo("<TR>\n");
$date = $r["date"];
$case_num = $r["case_num"];
$filename = $r["filename"];
echo("<TD>$date</TD>\n");
echo("<td>$case_num</td>\n");
echo("<td><a href='" . $r["filelocation"] . "'>" . $r["filename"] ."</td>\n");
echo("</tr>\n");
}
?>
</table><p>
<?php
if ($number ==0) {
echo("<b>Your search did not return any results<br><a href=d.php3>Please
click hear to try again.</a>");
}
?>