New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

mySQL question


Post Reply New Thread Subscribe

 
Thread Tools
gort

 
Member Since: Jul 25, 2004
Location: Gaithersburg, MD
Posts: 389
gort is on a distinguished road
Mac Specs: Mac Pro 2.6ghz Quad Xeon, 23" Cinema

gort is offline
I was wondering how to only get the first x number of characters in an SQL query. Like if you have a field called job_description and you want to only display the first 50 chars or so as a "preview." Do you think it would be easier to use a built-in PHP function to crop it or is there a way to do it with the select statement. I don't have any of my reference books handy so I can't look it up.
QUOTE Thanks
muso

 
muso's Avatar
 
Member Since: Jan 15, 2003
Location: Whangarei, New Zealand
Posts: 2
muso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond repute
Mac Specs: Pwnt

muso is offline
Personally I'd use PHP: http://www.php.net/substr

I'm in your forums, writing sentences in a grammatically acceptable manner.
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
LEFT(str,len)
Returns the leftmost len characters from the string str.

mysql> SELECT LEFT('foobarbar', 5);
-> 'fooba'
QUOTE Thanks

Post Reply New Thread Subscribe


« Flash MX Tutorials | Switching website from windows dreamweaver to mac »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Installing mySQl on Mac OS X sealey Web Design and Hosting 7 06-02-2005 10:45 PM
Postscript question battleangel444 OS X - Operating System 2 07-09-2004 12:45 PM
Any MySQL users (gurus) out there? mgm_03 OS X - Development and Darwin 5 05-03-2004 05:51 PM
MySQL password retardation mrtojamura OS X - Development and Darwin 0 02-19-2004 08:13 PM
MySQL Logging. . . RobotDeathSquad OS X - Development and Darwin 0 01-04-2004 07:04 PM

All times are GMT -4. The time now is 06:02 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?