Control the amount of response in a sql select?


I come back with another problem developing my cookbook app:

I work with 20 tables in a mysql database on my server. These tables contain recipes and the main rows are the name of a recipe, the needed ingredients and the preparation. The app user clicks on several buttons for making a choice “what kind of a recipe”. Then he enters a keyword for an sql select (i.a. within baking: “pizza”) He gets the number of found recipes and the names of the relevant recipes for the keyword. Now he can choose the number of a wanted recipe and gets back the ingredients and preparation description for this recipe.

My problem is the amount of the answers . If you use as a keyword only “blank”, you get some 515 answers of baking recipes or some ingredients and preparation cells are larger then my smartphone display (and I cannot use the “next”-button)

How can I handle/control the amount of response, i.e. with a scrolling technique on the display or what else??

Thanx in advance for any hint…

Bild1 Bild2 Bild3 .

You probably need to use TOP or LIMIT in your query:

I would test the filter field for blank before allowing the user to issue the query.

Alternatively, when the download arrives and has been loaded into a global variable table, test its length of list (number of rows) and if it's too high, just announce the number of rows.

Alternatively, offer a Divide and Conquer search into the downloaded cookbook, by alphabetic recipe name.

Thank you both for your very valuable hints.

  1. I understand them as solution to control the number of records in the result.

  2. How could I control/identify the amount of only one cell of the table? I will try it with a string-function

  3. And how can I find out the possible number of characters what my smartphone can display (in relation to some font size)?

  4. How can I divide the result in portions (let me say 80% of the display) and store the portions temporarily in a TinyDB? The division will also be tried with a string-function...

  5. How can I manipulate the font size of the display of the sql result?

Meanwhile I am successfully testing to control the number of displayed records and counting the string_length of cells. So I am testing the display capacity of my smartphone. by trial and error.

Still need hints for my above questions 4 and 5

I avoid issues 4 and 5 by using word wrap and scrolling ...

I get those for free in List Pickers.

Thank you ABG,

I understand scrollling: My Screen is checked scrolling.
What do you mean by "word wrap"? I am absolut beginner with list picker ...

This is word wrap.

It's all Greek to me...How do I separate a table cell into portions (without sql)?

A little javascript for splitting up long strings:

var wvs = window.AppInventor.getWebViewString();
var list = wvs.match(/.{1,6}/g);

This splits at 6 (six), so change the number accordingly.
Webviewer does not have to be visible


and a draggable procedure to do the same thing:

thank you TIMAI2. I will come back, if I have no success...

Now I stuck in producing an integer variable out of an sql result, concerning the number of characters of a string (in a table cell). I get the right number with the procedure blocks, but it is no number I can process as an integer number. The number comes out together with an sql variable called Laenge. I tried to feed the integer variable "global RezStringLaenge" width the "global result" of the query, but the result is a list...