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
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
You can do that with php using the substr() function: https://www.php.net/manual/en/function.substr.php
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?
It's really quite simple... instead of:
$Recordstet->getColumnVal("column")
use:
substr($Recordstet->getColumnVal("column"),0,150)
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
That should work... Do you have a URL and FTP access I can use to see the issue?
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
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.