close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Limit data in a recordset?

Thread began 1/25/2022 3:26 am by john70964 | Last modified 1/27/2022 9:15 am by Ray Borduin | 197 views | 6 replies |

john70964

Limit data in a recordset?

Hi Ray
Is there any way to limit the length of data in a recordset.
For example
If I wish to use only 150 characters of a field containing more, can this be done with a recordset?

Thanks
John

Sign in to reply to this post

Ray BorduinWebAssist

You can do that with php using the substr() function: https://www.php.net/manual/en/function.substr.php

Sign in to reply to this post
Did this help? Tips are appreciated...

john70964

Thanks Ray,
That's an amazing site and an amazing subject, beyond my pay grade.........

I suppose there are no less complicated solutions you know of?

Sign in to reply to this post

Ray BorduinWebAssist

It's really quite simple... instead of:

$Recordstet->getColumnVal("column")

use:
substr($Recordstet->getColumnVal("column"),0,150)

Sign in to reply to this post
Did this help? Tips are appreciated...

john70964

Hi Ray
I seem to have this working partly <?php echo(substr($rsTitle->getColumnVal("Description1"),0,150)); ?>"> but I am still seeing text well over the 150 setting.

I wondered if I have the above code correct?

I have attached the file.
Thanks
John

Sign in to reply to this post

Ray BorduinWebAssist

That should work... Do you have a URL and FTP access I can use to see the issue?

Sign in to reply to this post
Did this help? Tips are appreciated...

john70964

Hi Ray
I found my mistake, I had included an extra field in my selections from the recordset.

Sorry to have bothered you.
Thanks
John

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...