Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread heilo
wow! thats a much more elegant way to solve this sorting problem! didn't know usort up to now! simple&beautiful !! :) .ma Ford, Mike [LSS] <[EMAIL PROTECTED]> [EMAIL PROTECTED] 11:18 Uhr: >> -Original Message- >> From: heilo [mailto:[EMAIL PROTECTED] >> Sent: 03 June 2003

RE: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread Ford, Mike [LSS]
> -Original Message- > From: heilo [mailto:[EMAIL PROTECTED] > Sent: 03 June 2003 23:35 > > sorry, needed some time to hack this one ::) > > as your print_r shows that you have to sort an array which > includes objects > (in this case an ingress-class - whatever this is). i tried > to s

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread A. Lyse
It worked. Thanx! Why is this a bad solution? Will it slow down the feed? Regards, A. Lyse -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread heilo
i think this one should now work. remember that this is no very proper solution! it would be better not to work with such functions and access the database directly i think. .ma artikkelid = $artikkelid; $this->nettstedid = $nettstedid; $db = new pubSysDB(); /* K

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread A. Lyse
Almoust now! Got some (alot of errors) but it sorts correct: (see the errors here) http://www.amotor.no/artikler.php Here is altso the PubSysDB: http://www.amotor.no/pubSysDB.lib Regards, A. Lyse -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/uns

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread heilo
ok, add the following lines to your ingress.lib-file: /***/ // converts any array to an instance of the ingress-class function array2IngressClass($array) { $inst = new ingress(); while(list($key, $val) = each($array)) $inst->$key = $val;

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread A. Lyse
Here is the php file *** '.$i->overskrift.'   ('.$i->publisert.') '.$i->ingress.' ' ; } } ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread A. Lyse
This might helt some: The php file: http://www.amotor.no/list_ingresser_artikler.php The ingress.lib file: http://www.amotor.no/ingress.lib The comments might be a bit weird. Its norwegian :( Regards, A. Lyse -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://w

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread heilo
did you also copy the functions? A. Lyse <[EMAIL PROTECTED]> [EMAIL PROTECTED] 0:40 Uhr: > I get this error: > > Fatal error: Call to undefined function: sortclassarray() in > /home/amotor/www/list_ingresser_artikler.php on line 25 > > Regards, > A. Lyse > > -- PHP Database Mailing List (ht

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread A. Lyse
I get this error: Fatal error: Call to undefined function: sortclassarray() in /home/amotor/www/list_ingresser_artikler.php on line 25 Regards, A. Lyse -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread heilo
sorry, needed some time to hack this one ::) as your print_r shows that you have to sort an array which includes objects (in this case an ingress-class - whatever this is). i tried to simulate your environement and endet up with this: function array2IngressClass($array) { $inst =

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread A. Lyse
Hope I did this correctly now :) It is a new, "home made" news - system, only I want some new functions to it. I must make the functions myself then :( Here is the info: Array ( [0] => ingress Object ( [artikkelid] => 241 [nettstedid] => 11 [gyldig]

Re: [PHP-DB] PHP sort from a database variable..?

2003-06-04 Thread heilo
hi! we need information about how the array looks like! please add the following to your script (after merging $i1 and $i2): echo ''; print_r($ingresser); echo ''; and send the resulting output! you can use array_multisort for this problem. anyways i propose to write your own news-tool. sorting