i have a little problem getting to the results of a sql count function.
this is what i am trying to do:
table 1: product categories cid = uniek category_name = TEXT
table 2: products pid = uniek cid = link to category type = subcategorie (there are only 2 types) product_name = TEXT
I want a listview of all categories_name en the number of products of type 1 and type 2 that are in that categorie in to seperate <span class="ui-li-count">.
The sql and loop for the category listview is working fine, now i want to add a function to this loop that counts the number of type 1 en type 2 product in each category.
My problem is storing the result of the count function in a way that i can use it in the creation of the listview.
As de the result of this query will alway be a singel value there is no loop needed, and i want to store the callback of this function in the type 1 en type 2 vars i create in the categorie loop.
My question: How can i store the callback of the sql result in a variable so i can use it in the categorie loop.
if someone could point me in the right direction, any help would be much obliged.
i'm new to jquery/jquery mobile, and trying to build my first app with dynamic content from sqlite database. the basic functionality of the app is working, but i got some difficulty refreshing the dynamic content pages. In this app there can be several links to the same page with different argmuments to get the correct content from te database. so the page should be totaly rebuild before shown to the user.
The dynamic adding to de list works fine, but when i revisit the dynamic page with different arguments for adding content to the list, the old results (list) shows for a few seconts before rebuilding the list with de dynamic content of the new request.
CODE:
Menu links: (?order=... is removed by plugin and is stored in $.mobile.pageData)
<a href="#page_products?order=price">Order by Price</a>
<a href="#page_products?order=name">Order by Name</a>