Page 1 of 1

search users by begining of their user name

Posted: Thu Jun 01, 2006 2:15 pm
by Milan
if i have a table "USERS" and a filed "username" how could a display for example all users starting with "S" or "smi" for example?
could i just put WHERE username =S*

thanks.

Posted: Thu Jun 01, 2006 2:27 pm
by RobertGonzalez

Code: Select all

<?php
$sql = "SELECT * FROM USERS WHERE username LIKE 'S%'";
?>