A B C D E F index thingie

A

Anonymous

Guest
Got a table with a bunch of userinfo in it. the question is how can we get ONE sql statement to grab users beginning with A or a from the qery string.

After we get the first letter working I may have issues with the case sensitve stuff.

Code:
useradmin.php?charindex=S

I really want to get away from flipping through the entire table and checking each one AFTER the sql selects all the records. I'd just like to do it in the SQL
 
Am I getting close?

Code:
WHERE exhile != 'exhiled' AND userfield LIKE %" . $_GET['charindex'] . "

Still, i cannot post code with any length.. I thought that was fixed.
 
KillGorack said:
Am I getting close?

Code:
WHERE exhile != 'exhiled' AND userfield LIKE %" . $_GET['charindex'] . "

Still, i cannot post code with any length.. I thought that was fixed.

try this
Code:
$charIndex = strtolower($_GET['charindex']);

$sql = "... WHERE exhile != 'exhiled' AND userfield LIKE '{$_GET['charindex']}%' ";
 
Back
Top