Forum Moderators: coopster

Message Too Old, No Replies

Case Sensitivity

MYQSL Results

         

Seamless

9:59 am on Mar 27, 2006 (gmt 0)

10+ Year Member



I do apologise if this has been covered before...

I'm retrieving some results from a mysql database and i'm using mysql_fetch_array() everything works fine..

Apart from the results are not case sensitive, i've checked the database using phpMyAdmin and the values stored ARE case sensitive what am i doing wrong?

here's a peice of code as an example

<?
$sql = "SELECT * FROM table ORDER BY signup_date DESC LIMIT 5";
$result = mysql_query($sql) or die ("ERROR: ".mysql_error()." with query: $sql");
while($row = mysql_fetch_array($result)){
echo "<tr>
<td class='profile_name'>
<p><a href='user-profile.php?username=$row[username]'>$row[username]</a></p>
</td>";
// Format date
$signup_date = date('d-m-y', strtotime($row[signup_date]));
echo "<td class='signup_date'>
<p>$signup_date</p>
</td>
</tr>";
}
?>

Thanks in advance

Seamless

barns101

12:17 pm on Mar 27, 2006 (gmt 0)

10+ Year Member



By default, SELECT is not case sensitive.

MySQL.com:

If you want to make this search case sensitive, make sure that one of the operands has a case sensitive or binary collation.

[dev.mysql.com...]