[PHP-DB] SELECT WHERE length of content question

2011-03-09 Thread Ron Piggott

Is there a command in mySQL that would allow me to SELECT the rows where the 
`fax` column is more than 11 characters long? 

OR 

Do I need to use PHP to assess this?

Ron

The Verse of the Day
“Encouragement from God’s Word”
http://www.TheVerseOfTheDay.info 


Re: [PHP-DB] SELECT WHERE length of content question

2011-03-09 Thread kesavan trichy rengarajan
Have a look at this:
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_char-length

On Thu, Mar 10, 2011 at 9:49 AM, Ron Piggott ron.pigg...@actsministries.org
 wrote:


 Is there a command in mySQL that would allow me to SELECT the rows where
 the `fax` column is more than 11 characters long?

 OR

 Do I need to use PHP to assess this?

 Ron

 The Verse of the Day
 “Encouragement from God’s Word”
 http://www.TheVerseOfTheDay.info



Re: [PHP-DB] SELECT WHERE length of content question

2011-03-09 Thread Daniel Brown
On Wed, Mar 9, 2011 at 17:49, Ron Piggott
ron.pigg...@actsministries.org wrote:

 Is there a command in mySQL that would allow me to SELECT the rows where the 
 `fax` column is more than 11 characters long?

There is.

SELECT * FROM tblName WHERE CHAR_LENGTH(fax) = 11;

(Presuming you meant greater than or equal to eleven, as in an
invalid US/Canadian phone number.)

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php