



Then run the built in function mysql_query().I took name and quantity input from user.If connection failure, then error message will be shown.In here, I connected with MySql database.In Canteen constructor I created the instance of database.the if statement shows the successful or failed connection.

(MySql server should open while connecting) mysql_real_connect connects to the database.mysql_init is the initializer of mysql_real_connect.This class contains connection of the database.res is for getting all the values form the database.row is for getting the current row of the database.qstate represent the state of the query.Our main class is Canteen class and this class has some public functions like show, allItems, soldItems, addNewItem, editItem, deleteItem, searchById, searchByName, checkQuantity, addNewSale.īelow are the things we can do in this program:Ĭanteen Management System Program Detail: Global variables The program has a database connection class call at the beginning of the program. Canteen Management System Program in C++ and MySQL Description: You can see the full list of items stored in Canteen. The program can store new canteen item, edit them, delete them. C++ Program: Canteen Management System in C++ and MySQL Introduction:
