Re: [PHP] determining number of rows in a mysql table

2004-04-02 Thread Leung WC
-{ Rene Brehmer }- wrote: Thought it looked fishy hehe ... My only problem is: Sometimes you actually need the data from that table later in the same script, so instead of doing another data pull, I have alot of cases where this is alot more useful (not actual code from any of my work, bu

[PHP] re:[PHP] determining number of rows in a mysql table

2004-03-31 Thread Andy B
"I don't use colour in emails to this (or any) list, sorry. I would have hoped the screen reader said "asterisk asterisk highlighted"" all i heard it say was *** on the line that said something like "***highlighted..." but thats whas only when you referrenced to you highlighted the stuff... an

Re: [PHP] re:[PHP] determining number of rows in a mysql table

2004-03-31 Thread Richard Davey
Hello Andy, Wednesday, March 31, 2004, 7:21:44 PM, you wrote: AB> i know what you mean... if you highlighted the part you were talking about AB> with color then would explain why i didnt get what part you were talking AB> about... my screen reader doesnt pay much attention to color highlights so

[PHP] re:[PHP] determining number of rows in a mysql table

2004-03-31 Thread Andy B
"I **highlighted** the relevant part for you :)" i know what you mean... if you highlighted the part you were talking about with color then would explain why i didnt get what part you were talking about... my screen reader doesnt pay much attention to color highlights so probably missed it... sor

Re: [PHP] re:[PHP] determining number of rows in a mysql table

2004-03-31 Thread Richard Davey
Hello Andy, Wednesday, March 31, 2004, 7:02:59 PM, you wrote: AB> i guess that would work too if all you need is the # of rows in a table... AB> if you need it in an array then... ... then you read the part of my post that said "There's no need to extract the result into an array **in this insta

[PHP] re:[PHP] determining number of rows in a mysql table

2004-03-31 Thread Andy B
"$count = mysql_result($rows, 0, 'count');" i guess that would work too if all you need is the # of rows in a table... if you need it in an array then... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] determining number of rows in a mysql table

2004-03-31 Thread John W. Holmes
From: "Richard Davey" <[EMAIL PROTECTED]> > AB> $rows=mysql_query("select count(*) as count from users"); > AB> $count=mysql_fetch_array($rows); > > There's no need to extract the result into an array in this instance, > why bother giving PHP that extra overhead? Unless the query failed, > the va

Re: [PHP] determining number of rows in a mysql table

2004-03-31 Thread Richard Davey
Hello Andy, Tuesday, March 30, 2004, 6:48:47 AM, you wrote: AB> $rows=mysql_query("select count(*) as count from users"); AB> $count=mysql_fetch_array($rows); There's no need to extract the result into an array in this instance, why bother giving PHP that extra overhead? Unless the query failed,

Re: [PHP] determining number of rows in a mysql table

2004-03-29 Thread -{ Rene Brehmer }-
Thought it looked fishy hehe ... My only problem is: Sometimes you actually need the data from that table later in the same script, so instead of doing another data pull, I have alot of cases where this is alot more useful (not actual code from any of my work, but I've used this structure

Re: [PHP] determining number of rows in a mysql table

2004-03-29 Thread Jason Wong
On Tuesday 30 March 2004 13:48, Andy B wrote: > my screwup...forgot some code here... heres the whole thing that actually > works...(thats what you get for being in tons of different windows at the > same time)... > include("conf.db"); > mysql_connect($host, $mysqluser, $mysqlpwd); > $rows=mysql_

Re: [PHP] determining number of rows in a mysql table

2004-03-29 Thread Jason Wong
On Tuesday 30 March 2004 12:33, Andy B wrote: > "select count(*) from tablename" > > actually i would do: > $rows=mysql_query("select count(*) from tablename"); > > echo $rows; Hmmm, have you ever actually tried it? And got the result you wanted? -- Jason Wong -> Gremlins Associates -> www.greml

Re: [PHP] determining number of rows in a mysql table

2004-03-29 Thread Miles Thompson
select count(*) from tablename Miles At 12:12 PM 3/30/2004 +1000, Chris Wagner wrote: this should be easy... how would one go about determining the number of rows in a mysql table, without actually wasting the time of querying for *. is this the best way? $result = mysql_query('SELECT * FROM ta

Re: [PHP] determining number of rows in a mysql table

2004-03-29 Thread Richard Davey
Hello Chris, Tuesday, March 30, 2004, 3:12:26 AM, you wrote: CW> how would one go about determining the number of rows in a mysql table, CW> without actually wasting the time of querying for *. CW> is this the best way? CW> $result = mysql_query('SELECT * FROM tablename'); CW> $num_rows = mysql

Re: [PHP] determining number of rows in a mysql table

2004-03-29 Thread Daniel Guerrier
select count(*) from tablename --- Chris Wagner <[EMAIL PROTECTED]> wrote: > this should be easy... > > how would one go about determining the number of > rows in a mysql table, > without actually wasting the time of querying for *. > > is this the best way? > > $result = mysql_query('SELECT * F