close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to restrict rows in ItemLongDescription in search results page.

Thread began 6/05/2011 8:59 am by richard412075 | Last modified 6/07/2011 8:18 am by CraigR | 1578 views | 12 replies |

richard412075

How to restrict rows in ItemLongDescription in search results page.

Hi,

Not sure if anyone can help.

I am trying to restrict the ItemLongDescription row count to < 5 in the "Search - Results" page of dataAssist.

I can't find either a Constant or other value, and it just seems to output everything onto the search results Long Descrition, even though it puts a 'More' link that takes you to the Item detail.

Any ideas?

Many thanks, Richard....

Sign in to reply to this post

CraigRBeta Tester

Are you trying to restrict the number of rows returned to the first 5, or are you having an issue with pagination ?

If pagination, you can open up the repeat region server behavior and choose to show all records or choose to show 5 (or whatever) records at a time

Sign in to reply to this post

richard412075

Hi Craig,

I am trying to restrict the number of rows that the following call retrieves from the database:

<?php echo $row_WADAitems["ItemLongDesc"]

I think this is being set by

$row_WADAitems = mysql_fetch_assoc($WADAitems);

Any ideas?

Thanks for your help...

Regards, Richard.

Sign in to reply to this post

CraigRBeta Tester

Hi Richard.

Sorry, I'm still not clear if you are trying to restict your recordset to 5 rows per page, or limit the output to the first 5 rows only.#

Can you zip and upload your page ?

Sign in to reply to this post

richard412075

Hi Craig.

My fault, I am not being all together clear....

If you go to the following link:

garden.php

Look at the descriptions of the products (on the first page it probably starts:"this substantial frame" etc...) I need them to go as far down as the image (so about 6 columns down).

I will upload garden.php as well so you can see the code...

Thank you for the help with this... I just cant seem to get my head around it...

Attached Files
garden.zip
Sign in to reply to this post

CraigRBeta Tester

Hi, sorry for the delay in replying.

I think I understand, you have a field called itemlongdesc which contains a long text string, which you want to shorten , so it appears in 5 lines in the space provided. ?

There is a php function called strlen which you can use to return a partial string, which may give you what you want.

You may need a bit of trial and error to get it to fit to 5 lines.

I also have a function to trim a partial word from a string, which makes it look a bit neater, when you add the ...more ellipsis

Sign in to reply to this post

richard412075

Hi Craig,

Strlen returns the length of a string.

Basically what is happening is that I am using a copy of a WA DataAssist search results page to view products summaries. I need the summary to stop at about 5 columns, and cant find any variable or constant that defines this within the PHP produced by data assist.

Anyone else try the same thing?

Going to have to delve in to the PHP I think, but its not my strong point.

Any help would be hugely appreciated.

Kind regards, Richard.

Sign in to reply to this post

CraigRBeta Tester

Sorry, it was late last night.

The php function you want is substr()

You can find out more about it here...

func_string_substr.asp

Sign in to reply to this post

richard412075

Hi Craig,

SubStr will trim the length of a string but I think its the way that the Web Assist command that relates to: $row_WADAitems = mysql_fetch_assoc($WADAitems); is what needs chaning to restrict the number of rows that are returned.

Changing the string length would limit the width of what is returned into the page. I am looking to restrict the number of rows...

Regards, Richard.

Sign in to reply to this post

richard412075

OK, think I have worked it out, although I have got to write the PHP to fix it yet.

I was (wrongly) thinking that the "mysql_fetch_assoc" was returning an associated array, when in fact it is simply returning a text srting as it only returns one element.

I will therefore use the explode command (with a delimiter of say <br>) and then use only the first 5 elements of that array.

Thanks for the help Craig...

Sign in to reply to this post
loading

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...