Bug 777 - Sql statement Incorrect
Summary: Sql statement Incorrect
Status: RESOLVED FIXED
Alias: None
Product: CS3343 Salon Booking System
Classification: Unclassified
Component: admin.coupons.Create (show other bugs)
Version: 2.1
Hardware: PC Mac OS
: --- normal
Assignee: kwanng9@my.cityu.edu.hk
URL:
Depends on:
Blocks:
 
Reported: 2023-11-11 16:20 HKT by chtsang246-c
Modified: 2023-11-14 10:46 HKT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chtsang246-c 2023-11-11 16:20:13 HKT
"index" always 0 cause the first if-clause statement always false and incorrect sql statement.
Comment 1 shukhyiu2-c 2023-11-11 18:21:07 HKT
Bug resolved: Initializing index to 0 inside the loop
 
Previously, the index variable was incorrectly initialised to 0 for every iteration of the loop, causing the if-clause (index != 0) to always evaluate to False. This resulted in undesired behaviour.
 
Now, the bug has been fixed by moving the initialisation of index inside the loop, ensuring that it starts at 0 for each iteration. The if-clause will now correctly evaluate based on the updated value of index, resolving the issue.