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 Link to comment https://forums.phpfreaks.com/topic/93730-help-with-query/ 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' Link to comment https://forums.phpfreaks.com/topic/93730-help-with-query/#findComment-480291 Share on other sites More sharing options...
rsammy Posted February 29, 2008 Author Share Posted February 29, 2008 thanx mate. appreciate ur response. Link to comment https://forums.phpfreaks.com/topic/93730-help-with-query/#findComment-480468 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.