Show Record Count in Articles/Custom Modules?

Status
Not open for further replies.

terp

Beta Tester Extraordinaire
I was thinking about putting a custom module in my header with some language about how many records we have in the database; is there a way to inject a COUNT in a regular content article or a text/html module?

...not sure I can just use Select COUNT(Fabrik_ID) from mytable name;and given my lack of SQL bravado, I thought I would ask before I break something. ;)
 
Absolutely - the Fabrik tables are just normal MySQL tables. Doing a "select count" on them is perfectly safe.

-- hugh
 
Hugh Messenger said:
Absolutely - the Fabrik tables are just normal MySQL tables. Doing a "select count" on them is perfectly safe.

-- hugh

Thanks, Hugh; being new to Joomla, too, migrating over from DotNetNuke, I am wondering if I can just drop this is a custom module in the text field, or do I need a special mambot or plugin or something to insert raw SQL into a module?
 
..and one last follow-up. ;)

If I wanted to use the lowest value of a field, would I:

MIN(column)

I have a field for "bids" where they enter a bid...would like to show the lowest bid in some content areas...would I do something like:

The lowest bid entered is: Select MIN(bid) from jos_fabrik_xxxx ?

I am really going to try to learn SQL, which I should have by now...but been lazy having IT guys at work to do a query here and there for me of my datasets. :) I am going to get some class time and some books and get hot on this.
 
Hugh Messenger said:

a.) Yes, you can just enter raw code in any custom module or content area and execute the SQL
b.) Yes, your Select MIN(...) is the right approach to displaying the lowest volume of the column
c.) Yes, you need to take off the training wheels and just go for a ride, being on the right track with your ideas
d.) All of the above

:)
 
b), yes that's the right way to query MySQL.

Hmmm, there used to be a mambot called mosdbquery, which let you just execute simple queries for inserting into content ... but I can't find it published anywhere any more.

You may have to write your own little mambot or module to do this. There's nothing built it to Fabrik which will do it. Although I guess we could script up a quick hack to do the same job mosdbquery used to do.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top