Page 416 of 211,273, showing 20 records out of 4,225,455 total, starting on record 8,301, ending on 8,320
# | Username | Text | |
---|---|---|---|
# | Aug 10th 2008, 04:32 | darki | i need to get the next possible booking id - the first 3 numbers are set, only the last 2 numbers can change - so booking id is between 48900 and 48999 |
# | Aug 10th 2008, 04:32 | pgcd | martz: I think the simplest way would be for you to change that INT field into a string |
# | Aug 10th 2008, 04:33 | pgcd | i meant darki, sorry |
# | Aug 10th 2008, 04:33 | Martz | pgcd: simplest != bestest ;) |
# | Aug 10th 2008, 04:33 | darki | mh okay, than i can use wildcards instead of math condistion |
# | Aug 10th 2008, 04:33 | darki | ;) |
# | Aug 10th 2008, 04:33 | pgcd | that is very true =) |
# | Aug 10th 2008, 04:34 | darki | and i only have to find a way using wildcards ;) |
# | Aug 10th 2008, 04:34 | Martz | could try LIKE 489% |
# | Aug 10th 2008, 04:35 | darki | but if it is a string i cant add 1 - so if i find 48904 as last booking_id i cann use '48904'+1 to geht '48905' - i have to cast first |
# | Aug 10th 2008, 04:35 | darki | am i right? |
# | Aug 10th 2008, 04:35 | NetersLandreau | pgcd: i think you should be using [{$this->model->name}], shouldn't you? |
# | Aug 10th 2008, 04:35 | Martz | darki: what are you trying to achieve? Whats the bigger picture... |
# | Aug 10th 2008, 04:36 | darki | just want to have the next possible number - doesnt matter if it is a string or an int |
# | Aug 10th 2008, 04:36 | Martz | darki: no there is more than that, otherwise you would use auto increment? |
# | Aug 10th 2008, 04:37 | darki | no booking_id is not the pk - i have differents accounts: 489 490 491 etc. an every account can have booking ids (48901, 49001, 49002 ...) |
# | Aug 10th 2008, 04:37 | darki | so if ha make a booking on account 490 i have to find 49003 as next possible booking id |
# | Aug 10th 2008, 04:38 | pgcd | darki: what about a booking_id *and* an auto_increment? then you concat the two and you're set? |
# | Aug 10th 2008, 04:38 | Martz | darki: but booking_id should be the foreign key of Booking, which has a primary key right? So why not have a seperate field called "reference" and in your beforeSave() or similar, concat the primary key of the account and the foreign key of the booking ID |
# | Aug 10th 2008, 04:38 | pgcd | Neters: where exactly? in the extendedform thingy? |