[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Return Query Results with a limited number of characters

Asked by bernsoft1 in PHP Scripting Language

Tags: sql, php, asp

I have a table with names:

ID,Firstname,Lastname
1,Ben,Jack
2,James,Peter
3,Mary,Alice
4,Peyton,Sawyer
5,Lucas,Scott

I need to pull this information by a php script and have a response of MAX 20 character. i.e run a query then start from the top to construct variable of all records but MAX 20 characters e.g

$result = Ben,Jack\nJames,Peter\nMary,Alice
and continue for as long as LENGTH of $result is not more than 20 characters.


Help please.








[+][-]06/01/09 02:06 AM, ID: 24515869Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/01/09 10:54 AM, ID: 24519993Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/01/09 10:41 PM, ID: 24524135Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/02/09 11:34 AM, ID: 24529922Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/02/09 09:45 PM, ID: 24533416Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625