Jump to content

string length


tuzojazz

Recommended Posts

Hi:suppose I have this tableCUSTOMERS---------------------Name---------------------JohnGabrielGeorgeKenI need to make a query to get customers where the Name length is equal or greater than 6Name--------------------GabrielGeorgeHow Can I make this query or/and where can I find information about this kind of query?Thanks!!

Link to comment
Share on other sites

<?php$query = "SELECT * FROM `customers`";$result = mysql_query($result);while($row =mysql_num_rows($result){   if(strlen($row[0]) > 6){	  //do whatever, like echo the name or do what you want   }}?>

Hopefully this will help you :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...