Re: [PHP] count clicks to count most important news

2012-01-01 Thread muad shibani
All the answers are great but Stuart Dallas' answer is what I was asking about .. thank u all I really appreciate it a lot On Sun, Jan 1, 2012 at 11:10 PM, Stuart Dallas wrote: > On 1 Jan 2012, at 16:26, muad shibani wrote: > > > I have a website that posts the most important news according to t

Re: [PHP] count clicks to count most important news

2012-01-01 Thread Stuart Dallas
On 1 Jan 2012, at 16:26, muad shibani wrote: > I have a website that posts the most important news according to the number > of clicks to that news > the question is : what is the best way to prevent multiple clicks from the > same visitor? I'm assuming this is not a voting system, and the news

Re: [PHP] count clicks to count most important news

2012-01-01 Thread Maciek Sokolewicz
On 01-01-2012 20:08, Ashley Sheridan wrote: On Sun, 2012-01-01 at 11:49 -0500, Tedd Sperling wrote: On Jan 1, 2012, at 11:26 AM, muad shibani wrote: I have a website that posts the most important news according to the number of clicks to that news the question is : what is the best way to pr

Re: [PHP] count clicks to count most important news

2012-01-01 Thread Ashley Sheridan
On Sun, 2012-01-01 at 11:49 -0500, Tedd Sperling wrote: > On Jan 1, 2012, at 11:26 AM, muad shibani wrote: > > > I have a website that posts the most important news according to the number > > of clicks to that news > > the question is : what is the best way to prevent multiple clicks from the >

Re: [PHP] count clicks to count most important news

2012-01-01 Thread Tedd Sperling
On Jan 1, 2012, at 11:26 AM, muad shibani wrote: > I have a website that posts the most important news according to the number > of clicks to that news > the question is : what is the best way to prevent multiple clicks from the > same visitor? Not a fool-proof method, but use Javascript on the

[PHP] count clicks to count most important news

2012-01-01 Thread muad shibani
I have a website that posts the most important news according to the number of clicks to that news the question is : what is the best way to prevent multiple clicks from the same visitor?

RE: [PHP] Count the Number of Certain Elements in An Array

2010-01-11 Thread Alice Wei
> Date: Mon, 11 Jan 2010 18:31:43 -0300 > Subject: Re: [PHP] Count the Number of Certain Elements in An Array > From: tapi...@gmail.com > To: aj...@alumni.iu.edu > CC: php-general@lists.php.net > > On Mon, Jan 11, 2010 at 6:21 PM, Alice Wei wrote: > > > > Hi,

Re: [PHP] Count the Number of Certain Elements in An Array

2010-01-11 Thread Jonathan Tapicer
On Mon, Jan 11, 2010 at 6:21 PM, Alice Wei wrote: > > Hi, > >  This seems like a pretty simple problem, but I can't seem to be able to > figure it out. I have a lot of elements in an array, and some of them are > duplicates, but I don't want to delete them because I have other purposes for > it

[PHP] Count the Number of Certain Elements in An Array

2010-01-11 Thread Alice Wei
Hi, This seems like a pretty simple problem, but I can't seem to be able to figure it out. I have a lot of elements in an array, and some of them are duplicates, but I don't want to delete them because I have other purposes for it. Is it possible for me to find out the number of certain ele

Re: [PHP] count() total records for pagination with limit

2009-04-14 Thread PJ
Chris wrote: > PJ wrote: >> I seem to recall that it is possible to count all instances of a query >> that is limited by $RecordsPerPage without repeating the same query. I >> believe that COUNT() had to called immediately after the SELECT word but >> I neglected to bookmark the source. Dummy! > >

Re: [PHP] count() total records for pagination with limit

2009-04-14 Thread Chris
PJ wrote: I seem to recall that it is possible to count all instances of a query that is limited by $RecordsPerPage without repeating the same query. I believe that COUNT() had to called immediately after the SELECT word but I neglected to bookmark the source. Dummy! You're probably thinking of

[PHP] count() total records for pagination with limit

2009-04-14 Thread PJ
I seem to recall that it is possible to count all instances of a query that is limited by $RecordsPerPage without repeating the same query. I believe that COUNT() had to called immediately after the SELECT word but I neglected to bookmark the source. Dummy! I don't like the idea of count(*) over co

Re: [PHP] Count the Number of Elements Using Explode

2008-11-01 Thread Lars Torben Wilson
2008/10/31 Stut <[EMAIL PROTECTED]>: > On 31 Oct 2008, at 17:32, Maciek Sokolewicz wrote: >> >> Kyle Terry wrote: >>> >>> -- Forwarded message -- >>> From: Kyle Terry <[EMAIL PROTECTED]> >>> Date: Fri, Oct 31, 2008

Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Stut
On 31 Oct 2008, at 17:32, Maciek Sokolewicz wrote: Kyle Terry wrote: -- Forwarded message -- From: Kyle Terry <[EMAIL PROTECTED]> Date: Fri, Oct 31, 2008 at 9:31 AM Subject: Re: [PHP] Count the Number of Elements Using Explode To: Alice Wei <[EMAIL PROTECTED]> I wo

Re: Fwd: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Maciek Sokolewicz
Kyle Terry wrote: -- Forwarded message -- From: Kyle Terry <[EMAIL PROTECTED]> Date: Fri, Oct 31, 2008 at 9:31 AM Subject: Re: [PHP] Count the Number of Elements Using Explode To: Alice Wei <[EMAIL PROTECTED]> I would use http://us2.php.net/manual/en/function

Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Matthew Powell
Diogo Neves wrote: Hi Alice, U can simple do: $nr = ( strlen( $message ) / 2 ) + 1 ); $nr = count( explode( '|', $message ); Or... $num = (substr_count($message, "|") + 1); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Alice Wei
ate: Fri, 31 Oct 2008 17:00:44 + > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > CC: [EMAIL PROTECTED]; php-general@lists.php.net > Subject: Re: [PHP] Count the Number of Elements Using Explode > > Hi Alice, > > U can simple do: > $nr = ( strlen( $message ) / 2 )

Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Diogo Neves
Hi Alice, U can simple do: $nr = ( strlen( $message ) / 2 ) + 1 ); $nr = count( explode( '|', $message ); On Fri, Oct 31, 2008 at 4:32 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Fri, Oct 31, 2008 at 11:29 AM, Alice Wei <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have a code snippet h

Re: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Daniel Brown
On Fri, Oct 31, 2008 at 11:29 AM, Alice Wei <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a code snippet here as follows: > > $message="1|2|3|4|5"; > $stringChunks = explode("|", $message); > > Is it possible to find out the number of elements in this string? It seems > that I could do things

Fwd: [PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Kyle Terry
-- Forwarded message -- From: Kyle Terry <[EMAIL PROTECTED]> Date: Fri, Oct 31, 2008 at 9:31 AM Subject: Re: [PHP] Count the Number of Elements Using Explode To: Alice Wei <[EMAIL PROTECTED]> I would use http://us2.php.net/manual/en/function.array-count-values.php

[PHP] Count the Number of Elements Using Explode

2008-10-31 Thread Alice Wei
Hi, I have a code snippet here as follows: $message="1|2|3|4|5"; $stringChunks = explode("|", $message); Is it possible to find out the number of elements in this string? It seems that I could do things like print_r and find out what is the last element of $stringChunks is, but is th

Re: [PHP] Count

2008-01-17 Thread Mike Smith
Steve, Check out the while loop (http://us.php.net/manual/en/control-structures.while.php). It'll do what you need. -- Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Count

2008-01-17 Thread Pastor Steve
Richard, Thank you so much for your response. The select would be created from the number of records in the db. $variable2 The problem that I am having is rather than getting just the number of records, which is 3 currently, I would like it to be 1 for the first option, 2 for the second..., so

Re: [PHP] Count

2008-01-17 Thread Richard Heyes
I am wanting to create an select menu for displaying the order of the item on a page. I am guessing that I need to get the count of how many items are in the db and them put them into a select menu. Your question doesn't really make a great deal of sense. Your SQL could be: SELECT COUNT(*) FROM

[PHP] Count

2008-01-17 Thread Pastor Steve
Greetings, I am wanting to create an select menu for displaying the order of the item on a page. I am guessing that I need to get the count of how many items are in the db and them put them into a select menu. Does anyone know how to do this or can point me in the right direction? I hope this ma

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread tedd
At 12:47 PM -0700 10/8/07, Kevin Murphy wrote: Is this a joke? You are using a LIMIT 1, so your count is always going to be 1. No, its not a joke. The answer is not going to always 1, its going to be 1 (the value exists in the DB at least once) or 0 (the value doesn't exist in the DB), that'

RE: [PHP] count vs mysql_num_rows

2007-10-08 Thread Jay Blanchard
[snip] > Is this a joke? You are using a LIMIT 1, so your count is always > going to be 1. No, its not a joke. The answer is not going to always 1, its going to be 1 (the value exists in the DB at least once) or 0 (the value doesn't exist in the DB), that's what I am trying to test for. I

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread Kevin Murphy
Is this a joke? You are using a LIMIT 1, so your count is always going to be 1. No, its not a joke. The answer is not going to always 1, its going to be 1 (the value exists in the DB at least once) or 0 (the value doesn't exist in the DB), that's what I am trying to test for. I don't n

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread Jim Lucas
Kevin Murphy wrote: I've got a little function that just checks to see if something is in a mysql db. There are several ways to do this and was curious as to the best way. The following are 2 (simplified) versions that work just fine. If these are the best ways, which of the following is better

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread mike
On 10/8/07, Kevin Murphy <[EMAIL PROTECTED]> wrote: > I've got a little function that just checks to see if something is in > a mysql db. There are several ways to do this and was curious as to > the best way. The following are 2 (simplified) versions that work > just fine. If these are the best wa

[PHP] count vs mysql_num_rows

2007-10-08 Thread Kevin Murphy
I've got a little function that just checks to see if something is in a mysql db. There are several ways to do this and was curious as to the best way. The following are 2 (simplified) versions that work just fine. If these are the best ways, which of the following is better from a performa

Re: [PHP] Count empty array

2006-12-21 Thread tg-php
Not sure why it does it, but doesn't seem to be a huge deal. I'm guessing it's because an empty string is still a string. It's not null. Anyway, it's documented at: http://us3.php.net/manual/en/function.explode.php A user writes: "If you split an empty string, you get back a one-element array

Re: [PHP] Count empty array

2006-12-21 Thread Martin Marques
On Thu, 21 Dec 2006, Kevin Murphy wrote: I'm wondering why this is. $data = ""; $array = explode(",",$data); $count = count($array); $count will = 1 $array has 1 element: An empty string. $data = "Test"; $array = explode(",",$data); $count = count($array); $count will = 1 $array has 1 ele

Re: [PHP] Count empty array

2006-12-21 Thread Jon Anderson
Kevin Murphy wrote: I'm wondering why this is. $data = ""; $array = explode(",",$data); $count = count($array); $count will = 1 $data = "Test"; $array = explode(",",$data); $count = count($array); $count will = 1 $data = "Test,Test"; $array = explode(",",$data); $count = count($array); $count

Re: [PHP] Count empty array

2006-12-21 Thread Robert Cummings
On Thu, 2006-12-21 at 13:31 -0800, Kevin Murphy wrote: > I'm wondering why this is. > > $data = ""; > $array = explode(",",$data); > $count = count($array); > $count will = 1 > > $data = "Test"; > $array = explode(",",$data); > $count = count($array); > $count will = 1 > > $data = "Test,Test"; >

[PHP] Count empty array

2006-12-21 Thread Kevin Murphy
I'm wondering why this is. $data = ""; $array = explode(",",$data); $count = count($array); $count will = 1 $data = "Test"; $array = explode(",",$data); $count = count($array); $count will = 1 $data = "Test,Test"; $array = explode(",",$data); $count = count($array); $count will = 2 Why doesn't

Re: [PHP] count string within a string

2006-11-17 Thread Eric Butera
On 11/17/06, Børge Holen <[EMAIL PROTECTED]> wrote: I've figured out I need the substr_count function. However, counting strings like this: [1] [2] [3] ... [215] ... inside a large string element. damn. The string got quite a few different numbers and keys but the main key is alway within [] and

[PHP] count string within a string

2006-11-17 Thread Børge Holen
I've figured out I need the substr_count function. However, counting strings like this: [1] [2] [3] ... [215] ... inside a large string element. damn. The string got quite a few different numbers and keys but the main key is alway within [] and is numeric. I imagine I could use a $counter++. I j

RE: [PHP] Count of elements in XML

2006-01-20 Thread Richard Correia
Hi Jay, Check the example at http://www.weberdev.com/Manuals/PHP/function.simplexml-element-children.html Thanks, Richard -Original Message- From: Jay Paulson [mailto:[EMAIL PROTECTED] Sent: Friday, January 20, 2006 11:06 PM To: PHP LIST Subject: [PHP] Count of elements in XML I was

[PHP] Count of elements in XML

2006-01-20 Thread Jay Paulson
I was wondering if there is a way to get the number of foo elements in my XML below? This way I could loop through each element and print out the attributes. $string = " 1 2 3 4 "; $xml = simplexml_load_string($string); // this doesn't return the correct number of elements but instead retu

Re: [PHP] Count and Preg_Replace Using Version 4.4.1

2005-12-04 Thread Shaun
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, Dec 04, 2005 at 07:00:00PM -, Shaun wrote: >> >> "comex" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > form'.$count.'... >> You can use preg_replace_callback or the e pattern modifier to

Re: [PHP] Count and Preg_Replace Using Version 4.4.1

2005-12-04 Thread Curt Zirzow
On Sun, Dec 04, 2005 at 07:00:00PM -, Shaun wrote: > > "comex" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > form'.$count.'... > You can use preg_replace_callback or the e pattern modifier to let you > run php code for the replacement: > http://us3.php.net/manual/en/functi

Re: [PHP] Count and Preg_Replace Using Version 4.4.1

2005-12-04 Thread comex
> form'.$count.'... You can use preg_replace_callback or the e pattern modifier to let you run php code for the replacement: http://us3.php.net/manual/en/function.preg-replace-callback.php http://us3.php.net/manual/en/reference.pcre.pattern.modifiers.php -- PHP General Mailing List (http://www.php

Re: [PHP] Count totals (might be 0T)

2005-04-22 Thread Richard Lynch
On Thu, April 21, 2005 3:36 pm, Ryan A said: > Hey, > Thanks for replying. > That means I will have to run a query per categorywhich I would like > to > avoid if possible as they could be > a high amount of categories as they are user created and not defined by > us. group by cno"; $cat_inf

RE: [PHP] Count totals(might be 0T)

2005-04-21 Thread Chris W. Parker
Ryan A on Thursday, April 21, 2005 3:03 PM said: > When I sql the DB I call it like this: select picture_name<,more > fields> from where cno= order by category. > > Any ideas as to how i get how many pics per category and size per > category? I'm not sure if its a

Re: [PHP] Count totals (might be 0T)

2005-04-21 Thread Tom Rogers
Hi, Friday, April 22, 2005, 8:03:06 AM, you wrote: RA> Hi again, RA> Am faced with a new problem (either that or working straight 10 hours is RA> catching up!) RA> Heres my table (easy to figure out so i wont waste your time explaining the RA> fields): RA> cno, RA> date_added, RA> pic_name, RA> p

Re: [PHP] Count totals (might be 0T)

2005-04-21 Thread Ryan A
Hey, Thanks for replying. That means I will have to run a query per categorywhich I would like to avoid if possible as they could be a high amount of categories as they are user created and not defined by us. Thanks, Ryan On 4/22/2005 12:08:31 AM, Drewcore ([EMAIL PROTECTED]) wrote: > run ano

[PHP] Count totals (might be 0T)

2005-04-21 Thread Ryan A
Hi again, Am faced with a new problem (either that or working straight 10 hours is catching up!) Heres my table (easy to figure out so i wont waste your time explaining the fields): cno, date_added, pic_name, pic_size_kb, pic_desc_text, pic_category the way i am displaying the data is like this (

Re: [PHP] count with match probelm

2005-03-24 Thread Jochem Maas
Richard Lynch wrote: ... $how_many = mysql_result(mysql_query("SELECT COUNT(*), MATCH(ad_sub, ad_text) AGAINST('$words') AS score from ".$tcname."ads WHERE MATCH(ad_sub, ad_text) AGAINST('$words') FROM ".$tcname."ads where is_confirmed=1"),0); H. Actually, I *can* tell you that you shouldn't

Re: [PHP] count with match probelm

2005-03-22 Thread Richard Lynch
On Tue, March 22, 2005 11:30 pm, Ryan A said: > $q=mysql_query("select cno,date_and_time,MATCH(ad_sub, ad_text) > AGAINST('$words') AS score from ".$tcname."ads WHERE MATCH(ad_sub, > ad_text) > AGAINST('$words') AND is_confirmed=1 LIMIT $limit1, $limit2"); This is pretty much a MySQL question, rea

[PHP] count with match probelm

2005-03-22 Thread Ryan A
Hi, I am running this kind of a statement: $q=mysql_query("select cno,date_and_time,MATCH(ad_sub, ad_text) AGAINST('$words') AS score from ".$tcname."ads WHERE MATCH(ad_sub, ad_text) AGAINST('$words') AND is_confirmed=1 LIMIT $limit1, $limit2"); which is running fine...my problem is I am using a

[PHP] "count" index prevents ldap_add() after ldap_search() directly

2004-08-09 Thread Chris Shenton
I'm doing a bunch of LDAP work with PHP-4.3.6 and keep running up against this annoyance. If I do an ldap_search() and get the first entry, I can't then tweak some of the attribute/values and then directly use ldap_add() to put a new version into the directory. The reason is that the ldap_get_en

Re: [PHP] COUNT(*) Output Question

2004-08-02 Thread Tom Ray [Lists]
Thanks JohnI didn't think of thatI've been working on this catalog admin interface for to long..my brain is mush. John W. Holmes wrote: From: "Tom Ray [Lists]" <[EMAIL PROTECTED]> $count=mysql_query("SELECT sku, COUNT(*) FROM orders GROUP BY sku"); But my question is how do I use P

Re: [PHP] COUNT(*) Output Question

2004-08-02 Thread John W. Holmes
From: "Tom Ray [Lists]" <[EMAIL PROTECTED]> > $count=mysql_query("SELECT sku, COUNT(*) FROM orders GROUP BY sku"); > > But my question is how do I use PHP to output the COUNT(*) results? When > I run the command when I'm logged into mySQL I get the following: I assume you're fetching associative

Re: [PHP] COUNT(*) Output Question

2004-08-02 Thread Curt Zirzow
* Thus wrote Tom Ray [Lists]: > Hey- > > I'm query my mySQL database to see how many of each Sku has been > ordered. I am doing my query as: > > $count=mysql_query("SELECT sku, COUNT(*) FROM orders GROUP BY sku"); alias the count(*) column: SELECT sku, COUNT(*) as qty FROM orders GROUP BY s

RE: [PHP] COUNT(*) Output Question

2004-08-02 Thread Brad Ciszewski
Wouldn't count(sku) work? -Original Message- From: Tom Ray [Lists] [mailto:[EMAIL PROTECTED] Sent: Monday, August 02, 2004 3:20 PM To: [EMAIL PROTECTED] Subject: [PHP] COUNT(*) Output Question Hey- I'm query my mySQL database to see how many of each Sku has been ordered.

[PHP] COUNT(*) Output Question

2004-08-02 Thread Tom Ray [Lists]
Hey- I'm query my mySQL database to see how many of each Sku has been ordered. I am doing my query as: $count=mysql_query("SELECT sku, COUNT(*) FROM orders GROUP BY sku"); But my question is how do I use PHP to output the COUNT(*) results? When I run the command when I'm logged into mySQL I get

Re: [PHP] count number of occurences of character in a string

2004-06-08 Thread Daniel Clark
substr_count() http://www.php.net/manual/en/function.substr-count.php >>what function can I use to count the number of occurences of a certain >>character in a string? >> >>-- >>Diana Castillo >>Global Reservas, S.L. >>C/Granvia 22 dcdo 4-dcha >>28013 Madrid-Spain >>Tel : 00-34-913604039 >>Fax :

RE: [PHP] count number of occurences of character in a string

2004-06-08 Thread rich
> > what function can I use to count the number of occurences of a certain > character in a string? substr_count() ...? rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] count number of occurences of character in a string

2004-06-08 Thread Richard Davey
Hello Diana, Tuesday, June 8, 2004, 11:11:27 AM, you wrote: DC> what function can I use to count the number of occurences of a certain DC> character in a string? substr_count or count_chars would work. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services "I

[PHP] count number of occurences of character in a string

2004-06-08 Thread Diana Castillo
what function can I use to count the number of occurences of a certain character in a string? -- Diana Castillo Global Reservas, S.L. C/Granvia 22 dcdo 4-dcha 28013 Madrid-Spain Tel : 00-34-913604039 Fax : 00-34-915228673 email: [EMAIL PROTECTED] Web : http://www.hotelkey.com http://www.dest

Re: [PHP] count the elements of each dimension of the array

2003-12-13 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote: I have this script: This is illegal. Only one pair of empty square brackets is allowed. How whould php know where to add the new key? $ojpp[][] = "1"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] count the elements of each dimension of the array

2003-12-12 Thread orlandopozo
I have this script: I want to count the elements of each dimension, but the script give me an error, thanks in advanced for any help.

Re: [PHP] count()

2003-12-06 Thread Anthony Ritter
Marek Kilimajer <[EMAIL PROTECTED]> wrote in message: > There are 10 '[PAGEBREAK]' substrings in the string. If the string is > split apart at these substrings, it will give you total 11 parts. Thank you. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http:

Re: [PHP] count()

2003-12-06 Thread Marek Kilimajer
Anthony Ritter wrote: Greetings- I'm have the follwing string called $text and throughout this string I'd like to split this into an array by calling spliti() at the tag called PAGEBREAK. So, I count the array elements starting at 0 and get to 9. When I call count(), I get 11. Could somebody pleas

[PHP] count()

2003-12-05 Thread Anthony Ritter
Greetings- I'm have the follwing string called $text and throughout this string I'd like to split this into an array by calling spliti() at the tag called PAGEBREAK. So, I count the array elements starting at 0 and get to 9. When I call count(), I get 11. Could somebody please explain why this is

RE: [PHP] Count online users question

2003-11-26 Thread Vail, Warren
rect in your original assumption that the count will almost never be very precise. Warren -Original Message- From: Mike D [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 2:57 PM To: [EMAIL PROTECTED] Subject: [PHP] Count online users question Hi all, I am trying to figu

[PHP] Count online users question

2003-11-26 Thread Mike D
Hi all, I am trying to figure an accurate way to calculate how many users are viewing a site, at any particular time. This task is very simple except for one part - How do you determine when a person has left the site...apache hasn't served anymore requests from a particular ip for xx minutes ??

Re: [PHP] Count lines or chars

2003-10-17 Thread Pavel Jartsev
Markus wrote: Hi PHP-gurus :-) I'd like to count the lines within a file and store the result within a variable. Every line begins with the char %. Would it be easier to count these chars and how could I do that? Thanks for your help. markus Maybe this way: $file = file( '/some/file.ext' ); $lines

RE: [PHP] Count lines or chars

2003-10-17 Thread Morten Skou
I guess you could do something like : That would count all the lines in the file. /Morten -Original Message- From: Markus [mailto:[EMAIL PROTECTED] Sent: 17. oktober 2003 11:25 To: [EMAIL PROTECTED] Subject: [PHP] Count lines or chars Hi PHP-gurus :-) I'd like to count the

[PHP] Count lines or chars

2003-10-17 Thread Markus
Hi PHP-gurus :-) I'd like to count the lines within a file and store the result within a variable. Every line begins with the char %. Would it be easier to count these chars and how could I do that? Thanks for your help. markus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vis

Re: [PHP] count() & numerical arrays....

2003-09-09 Thread Curt Zirzow
* Thus wrote CF High ([EMAIL PROTECTED]): > Hey all. > > Another simple, yet baffling for me, question: > > I have a comma delimited list of numbers; e.g. $num_list = "1,2,3,4" > > I split the number list to array -- $num_list_array = split("," $num_list) > > I then count the number of elements

Re: [PHP] count() & numerical arrays....

2003-09-09 Thread Brad Pauly
CF High wrote: I split the number list to array -- $num_list_array = split("," $num_list) Any ideas? split uses a regular expression. I think you want to use explode here. $num_list_array = explode(',', $num_list) - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] count() & numerical arrays....

2003-09-09 Thread Cesar Cordovez
Use explode instead... $num_list_array = explode("," $num_list) more information at php.net/explode Cesar CF High wrote: Hey all. Another simple, yet baffling for me, question: I have a comma delimited list of numbers; e.g. $num_list = "1,2,3,4" I split the number list to array -- $num_list_

[PHP] count() & numerical arrays....

2003-09-09 Thread CF High
Hey all. Another simple, yet baffling for me, question: I have a comma delimited list of numbers; e.g. $num_list = "1,2,3,4" I split the number list to array -- $num_list_array = split("," $num_list) I then count the number of elements -- $count = count($num_list_array); I do not get 4 for $co

Re: [PHP] count rows

2003-08-22 Thread [EMAIL PROTECTED]
mysql_num_rows gives the number of rows. But don't even think of doing it this way if you just want the number of rows and don't want the data. The correct way is to use a query such as [sql] select count(*) from table [/sql] this will return just one row and it wil tell you how many rows are

[PHP] count rows

2003-08-22 Thread John Taylor-Johnston
Help me out here. I want to get a numeral on the number of records in a table. What is the function? http://www.php.net/manual-lookup.php?pattern=fetch%2Brows&lang=en http://www.php.net/manual-lookup.php?pattern=fetch%2Brecords&lang=en ? :) John -- PHP General Mailing List (http://www.php.net/

Re: [PHP] COUNT(*)

2003-08-01 Thread Richard Baskett
! Rick In order to seek truth it is necessary once in the course of our life to doubt as far as possible all things. - Rene Descartes > From: Yury B. <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > Date: Thu, 31 Jul 2003 19:46:40 +0200 > To: [EMAIL PROTECTED] > Subject: [PHP

[PHP] COUNT(*)

2003-08-01 Thread Yury B .
Hi I used to use old fashioned mysql quieries but moderm mysql apparently became more flexible so. I want to understand how to use some of the new features like COUNT(*) Let's say I have $result="SELECT COUNT(*) FROM pet"; $sql=mysql_query($result); while ($row=mysql_fetch_array($sql)){

[PHP] Count on Multiple Tables

2003-06-05 Thread Ralph
I've been stuck on this one all morning. Can't seem to figure it out. I have 2 tables, one with affiliate sales and another with affiliate clickthroughs. I have to query both tables, so that I can get clickthrough dates, hits, and then query affiliate sales table to get number of orders for each d

Re: [PHP] count up from 7

2003-03-25 Thread David T-G
Richard -- ...and then Richard Whitney said... % % Braindead! Hey, who are you callin' names?!? % % I need to evaluate a number if greater than 7 and add a value per increment. Greater than seven is easy. Adding a value is easy. Per increment can be a little tricky but we'll assume for the

Re: [PHP] count up from 7

2003-03-24 Thread Sebastian
not sure if this is what you're looking for: if ( $var > 7 ) { // do stuff } - cheers, Sebastian - Original Message - From: "Richard Whitney" <[EMAIL PROTECTED]> | Braindead! | | I need to evaluate a number if greater than 7 and add a value per increment. | I'm frazzled and can't thi

Re: [PHP] count up from 7

2003-03-24 Thread Justin French
Huh? Not really following what you want to achieve, but: $floor) { $diff = $n - $floor; //eg 2 // no idea what you want to do from here } ?> on 25/03/03 10:58 AM, Richard Whitney ([EMAIL PROTECTED]) wrote: > Braindead! > > I need to evaluate a number if greater than 7 and a

[PHP] count up from 7

2003-03-24 Thread Richard Whitney
Braindead! I need to evaluate a number if greater than 7 and add a value per increment. I'm frazzled and can't think straight. Thanks Guys! -- Richard Whitney * Transcend Development Producing the next phase of your internet presence. [EMAIL PROTECTED] * http://xend.net* 602-971-2791

Re: [PHP] count characters

2003-01-12 Thread Jason Sheets
Try the following code, please note you may want to trim() the string as well if it is coming from a user. Jason On Sun, 2003-01-12 at 10:32, [EMAIL PROTECTED] wrote: > I want to count characters without space "character". > $char="hello world" > so the result should be 10. > Can anybody help

Re: [PHP] count characters

2003-01-12 Thread Reuben D. Budiardja
On Sun, 12 Jan 2003 [EMAIL PROTECTED] wrote: > I want to count characters without space "character". > $char="hello world" > so the result should be 10. > Can anybody help me? $char="hello world"; $temp=str_replace(" ", "", $char); echo strlen($temp); should give you 10. RDB > > > --

[PHP] count characters

2003-01-12 Thread harald.mohring
I want to count characters without space "character". $char="hello world" so the result should be 10. Can anybody help me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] count characters without space

2003-01-11 Thread Jeffrey B. Ferland
> who knowes how to count the charcaters in a string without the space > character? Using a regular expression to strip out all the spaces before passing to the word counting function seems easiest. You'll be left to adapt it to PHP, but the regexp is: 's/ //g' That removes all spaces. If it gives

Re: [PHP] count characters without space

2003-01-11 Thread Gerald Timothy Quimpo
On Saturday 11 January 2003 08:51 pm, [EMAIL PROTECTED] wrote: > who knowes how to count the charcaters in a string without the space > character? you need to be more clear. number of characters in the string except space? number of distinct characters in the string except space? include other no

[PHP] count characters without space

2003-01-11 Thread harald.mohring
who knowes how to count the charcaters in a string without the space character? thanks harry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Count lines from php files

2002-12-12 Thread Antti
How can I count how many code lines I have written? I have many php files in one directory. I'm using linux.Do you know any non-php way to count the lines. thanks, antti -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Count in PHP

2002-09-09 Thread xdrag
why not: "select count(*) as counter from table" - Original Message - From: "Tyler Longren" <[EMAIL PROTECTED]> To: "Chuck "PUP" Payne" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, September 10, 2002 1:02 PM

Re: [PHP] Count in PHP

2002-09-09 Thread Tyler Longren
$sql = mysql_query("SELECT * FROM table ORDER BY whatever"); echo(mysql_num_rows($sql)); that should do it. tyler On Tue, 10 Sep 2002 00:58:26 -0400 "Chuck \"PUP\" Payne" <[EMAIL PROTECTED]> wrote: > I am wanting to do a count in PHP. I want to be able to count the > number of records from a g

RE: [PHP] Count in PHP

2002-09-09 Thread Martin Towell
it's best done in sql using "select count(*)" but can be done in php by looping through the result set -Original Message- From: Chuck "PUP" Payne [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 2:58 PM To: PHP General Subject: [PHP] Count in PHP I

[PHP] Count in PHP

2002-09-09 Thread Chuck \"PUP\" Payne
I am wanting to do a count in PHP. I want to be able to count the number of records from a given database and display this count on the page. Can this be done using PHP or is the sql thing? Chuck Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/

[PHP] count errors

2002-08-29 Thread WANDA HANSEN
I have a function that resets the count of fields with certain values when called. 99.9 percent of the time it works fine. However occaisionally it wont update the database. Even after breaking the selects up it still fails sometimes. If anyone has an idea of why I would really appreciate hearing

Re: [PHP] Count number of rows in table.

2002-08-25 Thread Chris Shiflett
I think you were on the right track with your first response. Selecting a count(*) gives you the number of rows returned without the overhead of actually returning all of the rows to PHP. Most people will rename the count as something more easy to reference (and/or more descriptive) in the res

Re: [PHP] Count number of rows in table.

2002-08-25 Thread salamander
okay, so then a "select *" and then a num_rows ... On Sunday, August 25, 2002, at 10:11 AM, Jason Wong wrote: > On Sunday 25 August 2002 22:07, salamander wrote: >> or, you should be able to simply do this, without the cost of fetching >> the results: >> >> $result = mysql_query("SELECT count(*)

Re: [PHP] Count number of rows in table.

2002-08-25 Thread Jason Wong
On Sunday 25 August 2002 22:07, salamander wrote: > or, you should be able to simply do this, without the cost of fetching > the results: > > $result = mysql_query("SELECT count(*) FROM table WHERE"); > $num_rows = mysql_num_rows($result); > echo "$num_rows Rows\n"; No. This only returns 1 row re

Re: [PHP] Count number of rows in table.

2002-08-25 Thread salamander
or, you should be able to simply do this, without the cost of fetching the results: $result = mysql_query("SELECT count(*) FROM table WHERE"); $num_rows = mysql_num_rows($result); echo "$num_rows Rows\n"; >> $sql = "select count(*) from table_name WHERE ."; >> $result = mysql_query($sql) o

  1   2   >