Hi,
For my final project,I must do cafeteria systems with mysql backend
database.
This is my system.
Student will have $10 and will deduct for breakfast,lunch and dinner.If
they eat breakfast $2,so the money will become $8.At the end of the
day,they will have $0.
Ok,I know how to do that.
But how come I using mysql that at 12 pm,the student money will back to
$10.
Thanks.
-iZMAN 1 1414 iz********@gmai l.com wrote: Hi, For my final project,I must do cafeteria systems with mysql backend database.
This is my system.
Student will have $10 and will deduct for breakfast,lunch and dinner.If they eat breakfast $2,so the money will become $8.At the end of the day,they will have $0.
Ok,I know how to do that.
But how come I using mysql that at 12 pm,the student money will back to $10.
You could store each buy with a date, and only add the buys for today when
calculating the amount left.
Or the dirty way, which has no history of what the students has bougth (sp)
previously.
Store the amount left and the date of the purchase.
Then when you read/update the database, check if the date of the last
purchase is today, if not, reset the amount left, and set the date to today.
PS: Don't forget to credit the usenet when you deliver your report...
Leif This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Merlin |
last post by:
Hello all!
I'll make it short and sweet...
I have a database, it looks something like this:
id data
--- -------------------------
0 Some Data
1 Some Other Data
2 Some More Other Data
|
by: red85 |
last post by:
hello i have mysql 4.1 with win2000 SP3, i know that it is only an
alpha and i don't know if someone else has already posted this
problem:
when i execute this sql
UPDATE tableX SET fieldX=valueX
WHERE id IN (SELECT tX.id FROM tableX AS tX WHERE tX.fieldY=valueY AND
filedZ=valueZ);
|
by: Fraser Hanson |
last post by:
Hello,
I have a table which has a foreign key relationship with itself. I
want and expect my updates to cascade (deletes definitely cascade as
expected) but instead I just get error 1217: foriegn key error.
I have written example code to use in reproducing the problem:
# Create the table
|
by: jayson_13 |
last post by:
Hi,
I need to implement a counter and i face problem of locking so hope
that u guys can help me.
I try to do test like this :
1st connection
SELECT * FROM nextkey WHERE tblname = 'PLCN' FOR Update;
(when i execute this statement and i guess that this will lock the
|
by: Carlos Eduardo Peralta |
last post by:
Hello:
Can i update a MySQL database with just copy the files MYI MYD and FRM
in the right dir? I know this work. The question is how MySQL manage
the user that are usig that database in that moment. Can i close all
the connection to that database? How can i tell MySQL deamon that
don´t use that database any more?
Thank you in advance.
| |
by: Kyle Arrington |
last post by:
I have a network server with MySQL on it and I am trying to make
access update the information it has in its linked table on startup or
command. I know nearly nothing about macros or modules. I am
basically wanting to make sure that the data access is displaying is
the most current data on the server.
Thanks.
|
by: frankscherr |
last post by:
Hey there,
I can't remember how to automaticly update the db. I used to do it manually as the provider wasn't running MySql 5.0.x but does now.
I want s.th like
delete * where currentdate() > thisdate()
automated everyday.
|
by: kelleyvanevert |
last post by:
Hello everyone,
This question is often asked, and I know there are lots and lots of answers that I could be using, but I just want a clear good answer.
I am making a website (for playing a game called Go).
It has a page for each game of course.
I'm making the website in PHP and MySQL, I know that for 'real-time' games another solution would probably be better, but I'm learning to master php and MySQL.
The game is shown via the <canvas>...
|
by: vjayis |
last post by:
hi
i have an database in which i need to update a status filed of an table with the date.
i,e those datas which gets expired are to be updated..
so need to run a command in mysql by default.,
any ideas??
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |