RE: [PHP] divide-column?

2005-08-30 Thread Murray @ PlanetThoughtful
> Murray @ PlanetThoughtful wrote: > >>Hi there! > >> > >>How do I do a sort in PHP where a column in a db must be two other > columns > >>divided...`? > > > > > > > > > > Hi Gustav, > > > > You should be able to use the divide operation in your query's ORDER BY > > clause. > > > > Eg > > > > SELE

Re: [PHP] divide-column?

2005-08-30 Thread Jasper Bryant-Greene
Murray @ PlanetThoughtful wrote: Hi there! How do I do a sort in PHP where a column in a db must be two other columns divided...`? Hi Gustav, You should be able to use the divide operation in your query's ORDER BY clause. Eg SELECT * FROM mytable ORDER BY (field1 / field2) You might ne

RE: [PHP] divide-column?

2005-08-30 Thread Murray @ PlanetThoughtful
> Hi there! > > How do I do a sort in PHP where a column in a db must be two other columns > divided...`? Hi Gustav, You should be able to use the divide operation in your query's ORDER BY clause. Eg SELECT * FROM mytable ORDER BY (field1 / field2) Regards, Murray --- "Lost in thought..."

[PHP] divide-column?

2005-08-29 Thread Gustav Wiberg
Hi there! How do I do a sort in PHP where a column in a db must be two other columns divided...`? I tried to use DIV-function in MySQL but it doesn't seem to work ): Of course, I can hard-code it, but i want this value because of sorting ten largest of the resultvalue. ($gradeJoke). Ten best

Re: [PHP] divide the text

2004-12-14 Thread Richard Lynch
Ahmed Abdel-Aliem wrote: > hi, > i have a page that views details of games from a database > i get the text and screen shots from the database, > i want to view 3 pictures among the text when i view it > how i can view the 1st picture after 1/3 of the text and the next one > after 2/3 of the text w

[PHP] divide the text

2004-12-14 Thread Ahmed Abdel-Aliem
hi, i have a page that views details of games from a database i get the text and screen shots from the database, i want to view 3 pictures among the text when i view it how i can view the 1st picture after 1/3 of the text and the next one after 2/3 of the text without affecting the text itself -

Re: [PHP] divide

2003-09-10 Thread CPT John W. Holmes
From: "phpu" <[EMAIL PROTECTED]> > I'm new in php and i've got allready a problem. > I wanna divide 2 numbers and the result to be an integer separated by comma. For example: > $number1=1000; > $number2=17; > $result=$number1 / $number2; > In this case the result is 588235.29411764 > And I

Re: [PHP] divide

2003-09-09 Thread Gabriel Guzman
On Tuesday 09 September 2003 05:04 pm, phpu wrote: > yes but if the result is a number like this 34056983 i wanna display this > number like this 34,056,983 Please help me with this one that's exactly what number_format() does... from the example on www.php.net/number_format : that's all the

Re: [PHP] divide

2003-09-09 Thread phpu
Sorry I've got it. Thanks a lot - Original Message - From: Nathan Taylor To: phpu Sent: Wednesday, September 10, 2003 2:59 AM Subject: Re: [PHP] divide Check out number_format() like I said. - Original Message - From: phpu To: Nathan Taylor

Re: [PHP] divide

2003-09-09 Thread phpu
yes but if the result is a number like this 34056983 i wanna display this number like this 34,056,983 Please help me with this one - Original Message - From: Nathan Taylor To: phpu Sent: Wednesday, September 10, 2003 2:49 AM Subject: Re: [PHP] divide Check out

[PHP] divide

2003-09-09 Thread phpu
Hello, I'm new in php and i've got allready a problem. I wanna divide 2 numbers and the result to be an integer separated by comma. For example: $number1=1000; $number2=17; $result=$number1 / $number2; In this case the result is 588235.29411764 And I wanna the result to be like this 588,23

Re: [PHP] Divide into words

2002-12-17 Thread Sean Burlington
how about ... Nope. The question was the position of the words, not how many times they appear. oops :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Divide into words

2002-12-16 Thread John W. Holmes
> > For example i have some words: > > > > Today is very beautiful day and sun is shining > > > > What i want to get from this is array > > > > words > > [Today] => 0 > > [Is] => 6,30 > > [Very] => 8 > > [beautiful] => 12 > > .. > > > > Can somebody please help me with this. Those nubers a

Re: [PHP] Divide into words

2002-12-16 Thread Sean Burlington
Uros Gruber wrote: Hi! For example i have some words: Today is very beautiful day and sun is shining What i want to get from this is array words [Today] => 0 [Is] => 6,30 [Very] => 8 [beautiful] => 12 .. Can somebody please help me with this. Those nubers are position of special word

Re: Re[2]: [PHP] Divide into words

2002-12-16 Thread 1LT John W. Holmes
> Yes, but my example was geared towards trying to work through a more > generic scenario. I'll bet if you try using perl regex with callback > it'll be even faster. I'll take that bet and say using preg_*_callback will be slower. :) I'll try and time each of them tonite and post what I find. Som

Re: Re[2]: [PHP] Divide into words

2002-12-16 Thread Marco Tabini
Yes, but my example was geared towards trying to work through a more generic scenario. I'll bet if you try using perl regex with callback it'll be even faster. Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Co

Re[2]: [PHP] Divide into words

2002-12-16 Thread Uros Gruber
Hi! I have dome almost the same $input = 'Today is a very beautiful day and the sun is shining'; $output = array(); $words = explode(' ',$input); $cur_pos = 0; foreach($words as $word) { if(!empty($output[$word])){ $output[$word] .= ','.$cur_pos; } else { $output[$word]

RE: [PHP] Divide into words

2002-12-16 Thread John W. Holmes
onals. Get your copy today. http://www.phparch.com/ > -Original Message- > From: Marco Tabini [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 16, 2002 12:37 PM > To: [EMAIL PROTECTED] > Cc: 'Uros Gruber'; PHP-General > Subject: RE: [PHP] Divide into words >

RE: [PHP] Divide into words

2002-12-16 Thread Marco Tabini
John, I'm not sure this will work if there is more than one space between words. Also, my previous example won't work if there are duplicate words (although it's easy to make an array out of each word and solve the problem), nor if the words are delimited by any character other than spaces, in wh

RE: [PHP] Divide into words

2002-12-16 Thread John W. Holmes
> For example i have some words: > > Today is very beautiful day and sun is shining > > What i want to get from this is array > > words > [Today] => 0 > [Is] => 6,30 > [Very] => 8 > [beautiful] => 12 > .. > > Can somebody please help me with this. Those nubers are > position of special

Re: [PHP] Divide into words

2002-12-16 Thread Marco Tabini
You could use strpos--there are easier ways if you don't need the offsets. Example: This is from memory, but it looks like it should work even for weird strings like the one above. Cheers, Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazin

[PHP] Divide into words

2002-12-16 Thread Uros Gruber
Hi! For example i have some words: Today is very beautiful day and sun is shining What i want to get from this is array words [Today] => 0 [Is] => 6,30 [Very] => 8 [beautiful] => 12 .. Can somebody please help me with this. Those nubers are position of special word in above sentence.