Note, if you are using MySQL, which I believe is the case, there is another trick another trick, which is more natural as it will ask the database to give you the next ID (assuming the ID columns are auto-increment, which is generally the case), and that should prevent any duplication as well as take account of deleted records and such.
Note, if you are using MySQL, which I believe is the case, there is another trick, which is more natural as it will ask the database to give you the next ID (assuming the ID columns are auto-increment, which is generally the case), and that should prevent any duplication as well as take account of deleted records and such.
Note, if you are using MySQL, which I believe is the case, there is another trick, which is more natural as it will ask the database to give you the next ID (assuming the ID columns are auto-increment, which is generally the case), and that should prevent any duplication as well as take account of deleted records and such.
###Good things
Good things
###Dead query
Dead query
###Row count
Row count
###Naming Things
Naming Things
###Good things
###Dead query
###Row count
###Naming Things
Good things
Dead query
Row count
Naming Things
$selectAllUserIds // instead of $query0
$selectAllNoticeCategoryIds // instead of $query1
$selectMaxNoticeCategoryIdPlusOne$selectNextNoticeCategoryId // instead of the above refactored $query1
$insertCategoryType // instead of $query2
$insertNotice // instead of $query3
$selectAllUserIds // instead of $query0
$selectAllNoticeCategoryIds // instead of $query1
$selectMaxNoticeCategoryIdPlusOne // instead of the above refactored $query1
$insertCategoryType // instead of $query2
$insertNotice // instead of $query3
$selectAllUserIds // instead of $query0
$selectAllNoticeCategoryIds // instead of $query1
$selectNextNoticeCategoryId // instead of the above refactored $query1
$insertCategoryType // instead of $query2
$insertNotice // instead of $query3