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

2003-06-04 Thread A. Lyse
Please dont kill me for posting here. I dont know where else to post. I'm a newbie and is completly stuck with a php problem :( I got this code (among with more though...): *** $i1=hentIngresser($nettstedid,38,$sprakid,$offsetannet,$antallmotor);

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 'pre'; print_r($ingresser); echo '/pre'; and send the resulting output! you can use array_multisort for this problem. anyways i propose to write your own news-tool.

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] = 1

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
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
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

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:

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

2003-06-04 Thread A. Lyse
Here is the php file *** ?php //Dette er en mal for å lette implementering av pusyset til de enkelte sider. //Denne malen viser ingressene til de 50 siste artikler denne siden skal ha. include ../lib/ingress.lib; $nettstedid=11; //Id til nettstedet. Dersom man ikke husker

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
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:

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 ?php include pubSysDB.lib; //Klasse som henter ut all relevant informasjon om en ingress og presenterer det som et

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 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 simulate

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! simplebeautiful !! :) .ma Ford, Mike [LSS] [EMAIL PROTECTED] [EMAIL PROTECTED] 11:18 Uhr: -Original Message- From: heilo [mailto:[EMAIL PROTECTED] Sent: 03 June 2003 23:35