# |
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:35 |
Martz |
darki: what are you trying to achieve? Whats the bigger picture... |
# |
Aug 10th 2008, 04:35 |
NetersLandreau |
pgcd: i think you should be using [{$this->model->name}], shouldn't you? |
# |
Aug 10th 2008, 04:35 |
darki |
am i right? |
# |
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:34 |
Martz |
could try LIKE 489% |
# |
Aug 10th 2008, 04:34 |
darki |
and i only have to find a way using wildcards ;) |
# |
Aug 10th 2008, 04:33 |
pgcd |
that is very true =) |
# |
Aug 10th 2008, 04:33 |
darki |
;) |
# |
Aug 10th 2008, 04:33 |
darki |
mh okay, than i can use wildcards instead of math condistion |
# |
Aug 10th 2008, 04:33 |
Martz |
pgcd: simplest != bestest ;) |
# |
Aug 10th 2008, 04:33 |
pgcd |
i meant darki, sorry |
# |
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: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 |
Neters: here it is - you'll see it's unlikely it has much of an impact... http://bin.cakephp.org/view/1537795777 |
# |
Aug 10th 2008, 04:31 |
Martz |
darki: but thats such a nasty thing to be doing in your app right? for a booking_id ? |
# |
Aug 10th 2008, 04:31 |
Martz |
or something along those lines? |
# |
Aug 10th 2008, 04:30 |
Martz |
where MAX(field) and field > 489000 AND < 489999 |
# |
Aug 10th 2008, 04:30 |
darki |
martz: guess you are right, i have to overthink how to find the biggest int starting with 489 for example |
# |
Aug 10th 2008, 04:29 |
NetersLandreau |
pgcd: you are close but there is something in the way you are redefining $form that is not exactly right |
# |
Aug 10th 2008, 04:28 |
primeminister |
is it nate? |
# |
Aug 10th 2008, 04:28 |
primeminister |
who is responsible for http://cake.insertdesignhere.com ? |
# |
Aug 10th 2008, 04:28 |
Martz |
something isnt right if you are doing an int with wildcard? Shouldnt it be > or < or = |
# |
Aug 10th 2008, 04:28 |
primeminister |
hi all |
# |
Aug 10th 2008, 04:27 |
darki |
i'll try |
# |
Aug 10th 2008, 04:27 |
NetersLandreau |
i feel badly when i have to refer anyone to the API.. but it is the absolute best source |
# |
Aug 10th 2008, 04:26 |
darki |
mh okay than i need search for my self - not fine because i'm under time pressure |
# |
Aug 10th 2008, 04:26 |
pgcd |
Neters: no, i mean the names i gave to the fields in the swfu init block |
# |
Aug 10th 2008, 04:25 |
NetersLandreau |
darki: that is a question i have seen debated quite often.. the new way to parse conditions has been lambasted in some circles but the coders end up coming around to the new system.. i just don't recall the exact way to do it atm |
# |
Aug 10th 2008, 04:24 |
darki |
i think i need something like "like" |
# |
Aug 10th 2008, 04:23 |
NetersLandreau |
pgcd: it is in the way you extended the form helper |
# |
Aug 10th 2008, 04:23 |
darki |
neters: should be but why dooes * not work? how can i get all fields beginning with 490 for example? |
# |
Aug 10th 2008, 04:23 |
Traveler0 |
*like |
# |
Aug 10th 2008, 04:23 |
pgcd |
Neters: I managed to populate $this->data (the fields had names like [data][Image][*], while it should have been data[Image][*]) |
# |
Aug 10th 2008, 04:22 |
Traveler0 |
live active = 1 |
# |
Aug 10th 2008, 04:22 |
Traveler0 |
how do i set a model condition? |
# |
Aug 10th 2008, 04:21 |
NetersLandreau |
darki: it would be find('all', array('conditions' => array('field' => 'data'))).. there is a new way of parsing the conditions and you're going to have to examine the API for the exact details on that |
# |
Aug 10th 2008, 04:20 |
darki |
($this->Booking->find('list', array('conditions' => array('booking_id' => '489*')))); gives me an empty array too - seems that * does not work :( |
# |
Aug 10th 2008, 04:19 |
NetersLandreau |
pgcd: in the future, you should be able to use css to get your icons, etc |
# |
Aug 10th 2008, 04:18 |
darki |
% does not work - ok i will try find |
# |
Aug 10th 2008, 04:18 |
pgcd |
I wouldn't know about wildcards with ints, tho |