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

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

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

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

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

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

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

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

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 w

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

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

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. I am doing my

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

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

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

RE: [PHP] Count online users question

2003-11-26 Thread Vail, Warren
If your website uses PHP sessions, and you store those sessions in a database table you could; $query = "select count(*) from session_table where " ."session_datetime > \"" .date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")." -1 hour")) ."\" "; ...the reset of a mysql que

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

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_

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

Re: [PHP] COUNT(*)

2003-08-01 Thread Richard Baskett
Actually that does retrieve the number of rows.. // Query $query = "SELECT COUNT(*) AS count FROM pet"; // Execute Query $result = mysql_query($query); // Get the result of query named count $count = mysql_result($result,0); echo $count." is the number of rows"; Cheers! Rick In order to seek

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

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

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

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 am wanting to do a count i

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

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

2002-08-25 Thread Bas Jobsen
> $sql = "select count(*) from table_name WHERE ."; > $result = mysql_query($sql) or die(mysql_error); > $row = mysql_fetch_row($result); > $rowCount=$row[0]; or $sql = "select count(*) from table_name WHERE ."; $result = mysql_query($sql) or die(mysql_error); $rowCount=mysql_result($resu

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

2002-08-25 Thread Matt
> select count(*) from table_name WHERE . > > >From: "Tony Harrison" <[EMAIL PROTECTED]> > Sent: Saturday, August 24, 2002 5:54 PM > Subject: Re: [PHP] Count number of rows in table. > > And do I need to use any other functions like mysql_fetch_row() ? >

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

2002-08-25 Thread Tony Harrison
And do I need to use any other functions like mysql_fetch_row() ? "Martín marqués" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Sáb 24 Ago 2002 11:19, Tony Harrison wrote: > > How would I count the number of rows in a mysql table with a WHERE clause? > > select count(*) fro

RE: [PHP] count link clicks

2002-08-13 Thread victor
; 'vic' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] count link clicks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 12:23 PM To: 'Rasmus Lerdorf'; 'vic' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] count link

RE: [PHP] count link clicks

2002-08-13 Thread vic
: 'Rasmus Lerdorf'; 'vic' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] count link clicks I think I'm on the right track with: New paragraph '; // Isert form html into $data_fields variable $data_fields = '

RE: [PHP] count link clicks

2002-08-13 Thread Dave at Sinewaves.net
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 12:23 PM To: 'Rasmus Lerdorf'; 'vic' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] count link clicks I think I'm on the right track with

RE: [PHP] count link clicks

2002-08-13 Thread Mike Dunlop
> >-Original Message- >From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, August 13, 2002 2:49 PM >To: [EMAIL PROTECTED] >Cc: [EMAIL PROTECTED] >Subject: Re: [PHP] count link clicks > >Write a link wrapper that you would use like this: > >

RE: [PHP] count link clicks

2002-08-13 Thread victor
I think I'm on the right track with: New paragraph '; // Isert form html into $data_fields variable $data_fields = ' New paragraph '; while ($i = $value) { echo $data_fields; } ?> The only problem is that it ru

RE: [PHP] count link clicks

2002-08-13 Thread Rasmus Lerdorf
age- > From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 13, 2002 3:05 PM > To: vic > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: [PHP] count link clicks > > > Really? That sounds more complicated than I think I need it to be, > can&

RE: [PHP] count link clicks

2002-08-13 Thread vic
I have no database, this has to be done in PHP - Vic -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 3:05 PM To: vic Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] count link clicks > Really? That sounds more complica

RE: [PHP] count link clicks

2002-08-13 Thread Rasmus Lerdorf
> Really? That sounds more complicated than I think I need it to be, can't > I use something like: > > '' > > and somehow (this is what I need to know) get $value to increase in > value as the user clicks on the link again and again... Nope, you would be fighting race conditions forever with an a

RE: [PHP] count link clicks

2002-08-13 Thread vic
text imput form onece and if the user clicks on the link the form (same) will be displayed again under the first one. - Vic -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 2:49 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [

Re: [PHP] count link clicks

2002-08-13 Thread Rasmus Lerdorf
Write a link wrapper that you would use like this: Then in wrap.php: -Rasmus On Tue, 13 Aug 2002 [EMAIL PROTECTED] wrote: > How do I count how many times a user clicks on a certain link? (and put > it into and array or variable I guess). > > I want to be able to repeat a certain action

RE: [PHP] Count

2002-02-25 Thread Jon Haworth
Hi, > I want to make this sql query visual does anybody have > any idea :-) > SELECT date_format(t_timestamp_opened,'%Y %m %d'), > count(date_format(t_timestamp_opened,'%Y %m %d')) > FROM crm.ticket group by date_format(t_timestamp_opened, > '%Y %m %d') order by t_timestamp_opened; Visual? W

Re: [PHP] Count concarent logins (newbie)

2002-02-08 Thread Dennis Moore
> > in A web site where logins are managed with php sesions > is it possible to count how many concurent users are loged in ?? > > I believe that one way is to keep in a mysql table every login > user but how can i delete a "loged-in" record when user session > terminates abnormal > If you use th

Re: [PHP] Count

2001-08-30 Thread sagar
> To: Kevin P <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, August 30, 2001 6:06 AM Subject: Re: [PHP] Count > On Thu, 30 Aug 2001 08:16, Kevin P wrote: > > Hi > > I have counted some rows in MySQL and I need to know how to pull out > > the number of ro

Re: [PHP] Count

2001-08-29 Thread David Robley
On Thu, 30 Aug 2001 08:16, Kevin P wrote: > Hi > I have counted some rows in MySQL and I need to know how to pull out > the number of rows. > "SELECT COUNT(*) AS myCount FROM Products" > > Thanks > Kevin $query = "SELECT COUNT(*) AS myCount FROM Products"; $result = mysql_db_query($database, $que

RE: [PHP] Count total

2001-08-19 Thread Don Read
On 19-Aug-2001 Martin Kampherbeek wrote: > Hi, > > Who can help me with the following problem? > I have the tables score and totalscore. > > Score: > id > userid > name > score > > Totalscore: > userid > name > totalscore > > In the table score one user can have mutiple scores. But in totalsc

Re: [PHP] Count total

2001-08-19 Thread Rasmus Lerdorf
On Sun, 19 Aug 2001, Martin Kampherbeek wrote: > Hi, > > Who can help me with the following problem? > I have the tables score and totalscore. > > Score: > id > userid > name > score > > Totalscore: > userid > name > totalscore > > In the table score one user can have mutiple scores. But in total

Re: [PHP] Count total

2001-08-19 Thread Chris Lambert
Assuming MySQL... /* Chris Lambert, CTO - [EMAIL PROTECTED] WhiteCrown Networks - More Than White Hats Web Application Security - www.whitecrown.net */ - Original Message - From: Martin Kampherbeek <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 19, 2001 5:34 AM Subject

Re: [PHP] count()?

2001-08-06 Thread Alexander Wagner
Jeremy Morano wrote: > Hi, I was woundering how to read and find the # of records in my > table... Do I use count()??? select count(*) from table regards Wagner -- Madness takes its toll. Please have exact change. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMA

Re: [PHP] count number of email sent to us

2001-07-19 Thread Jack
al Message - From: Francis Fillion <[EMAIL PROTECTED]> To: Jack <[EMAIL PROTECTED]> Cc: Zak Greant <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 10:19 AM Subject: Re: [PHP] count number of email sent to us > Yes you can send java

Re: [PHP] count number of email sent to us

2001-07-18 Thread Francis Fillion
our enemies, it will drive them nuts" > - Original Message - > From: Zak Greant <[EMAIL PROTECTED]> > To: Jack <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Wednesday, July 18, 2001 2:39 AM > Subject: Re: [PHP] count number of email sent to

Re: [PHP] count number of email sent to us

2001-07-18 Thread Zak Greant
Both topics are covered frequently :) --zak Jack wrote: > Sorry, It is mistyping here. I mean, we normally use variables from php to > do something in javascript function. But how could we use value from > variables in javascript function to do something in php function? -- PHP General Maili

Re: [PHP] count number of email sent to us

2001-07-18 Thread Jack
- Original Message - From: Zak Greant <[EMAIL PROTECTED]> To: Jack <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 2:39 AM Subject: Re: [PHP] count number of email sent to us > Check the list archives - this question gets posed quite often. >

Re: [PHP] count number of email sent to us

2001-07-18 Thread Zak Greant
Check the list archives - this question gets posed quite often. --zak - Original Message - From: "Jack" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 1:38 PM Subject: Re: [PHP] count number of email sent to us > Yes, that is th

Re: [PHP] count number of email sent to us

2001-07-18 Thread Jack
in <[EMAIL PROTECTED]> To: Jack <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 10:43 AM Subject: Re: [PHP] count number of email sent to us > hi jack, > > > the easiest way for you to do this is by using javascript. do somethins > lik

Re: [PHP] count number of email sent to us

2001-07-18 Thread halmi yasin
hi jack, the easiest way for you to do this is by using javascript. do somethins like: mailto:[EMAIL PROTECTED]"; onClick="countClick()">Big George and have a javascript function like: function countClick()"= { ...do stuffs } i dont know if you can embed php in javascr

Re: [PHP] count number of form fields?

2001-07-13 Thread py
A multiple dropdown lists will produce an array is you put [] when naming the list. You than need to count how many elements you have in the array. py p.s. it could be done in javascript as well, but it's so easy in php :) - Original Message - From: Jaxon <[EMAIL PROTECTED]> To: <[EMAIL

Re: [PHP] count() multidimensional array

2001-05-19 Thread Hugh Bothwell
""Dean Martin"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > My code to list only the rows that were checked is this.. > > for ($j=1 ; $j=5; $j++) > This code is creating an endless loop and times out the server with memory > overruns. > > What am I missing?

  1   2   >