Hi,

i am writing a program that is using a database to keep track of stocked items in a business. as a part of the program, i am having a function to count how many items are actually in the database and displaying it in a numerical form within a textbox.
i know how to write this using psuedo code, but im not sure how to go about it using the actual code.

START
VARIABLE a : string;

COUNT DATABASE ENTRIES
IF ITEM IS THERE, a+1
(continue till to next item in database untill reached the end)
ELSE
DISPLAY MESSAGE

END

any help would be greatly appreciated
cheers
AnniHilatE

What db are you using?

You should be doing that stuff in the database using a stored procedure or whatever. To count things in a database use something like :

select count(*)
from items

or to add up quantities

select sum(qty)
from stock
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.