I am trying to perform a query search for the lastname in a database(mySql) by searching the first letter of the lastname. I am using two drop-down boxes with an option to pick letters a-z so I can search for a name that falls between two letters.
mysql has a built in search function:
.... "Select * FROM $table WHERE lastname LIKE W%" ...
...which works fine when you use this as is or send a variable to it. What I need to do is use the between function with it..
... "Select ...... lastname BETWEEN $var1 AND $var2 ....
Can these two be combined some way.
The only other way I can think of going about this is some how do a search for lastname and use the substring shortcut...
$var{0} which gives the first letter of the name. I have no idea on how to script this so it works.
If any one has a better way or suggestion on how to go about this, I would appreciate the help. Hope this makes sense.
thanks for your time.