rsammy Posted February 29, 2008 Share Posted February 29, 2008 i have a query: SELECT * FROM orgs WHERE org_name='$org_name' AND org_type='$org_type' now, how can i get just the frist 8 characters of the org_name field? I want the query to return just 8 characters for me. Is this possible? thanx Quote Link to comment Share on other sites More sharing options...
fnairb Posted February 29, 2008 Share Posted February 29, 2008 Yes. Use left() and give it a nice label that makes sense to you. http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_left SELECT left(org_name, as cliped_org_name, * FROM orgs WHERE org_name='$org_name' AND org_type='$org_type' Quote Link to comment Share on other sites More sharing options...
rsammy Posted February 29, 2008 Author Share Posted February 29, 2008 thanx mate. appreciate ur response. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.