[PHP] Re: mysql_num_rows()

2011-02-24 Thread Pete Ford
On 22/02/11 14:40, Gary wrote: Pete Fordp...@justcroft.com wrote in message news:76.48.39221.054c3...@pb1.pair.com... On 22/02/11 13:59, Gary wrote: Pete Fordp...@justcroft.com wrote in message news:a4.c0.39221.b3ca3...@pb1.pair.com... On 22/02/11 05:40, Gary wrote: Can someone tell me

[PHP] Re: mysql_num_rows()

2011-02-22 Thread Pete Ford
On 22/02/11 05:40, Gary wrote: Can someone tell me why this is not working? I do not get an error message, the results are called and echo'd to screen, the count does not work, I get a 0 for a result... $result = mysql_query(SELECT * FROM `counties` WHERE name = 'checked') or

[PHP] Re: mysql_num_rows()

2011-02-22 Thread Gary
Pete Ford p...@justcroft.com wrote in message news:a4.c0.39221.b3ca3...@pb1.pair.com... On 22/02/11 05:40, Gary wrote: Can someone tell me why this is not working? I do not get an error message, the results are called and echo'd to screen, the count does not work, I get a 0 for a

[PHP] Re: mysql_num_rows()

2011-02-22 Thread Pete Ford
On 22/02/11 13:59, Gary wrote: Pete Fordp...@justcroft.com wrote in message news:a4.c0.39221.b3ca3...@pb1.pair.com... On 22/02/11 05:40, Gary wrote: Can someone tell me why this is not working? I do not get an error message, the results are called and echo'd to screen, the count does not

[PHP] Re: mysql_num_rows()

2011-02-22 Thread Gary
Pete Ford p...@justcroft.com wrote in message news:76.48.39221.054c3...@pb1.pair.com... On 22/02/11 13:59, Gary wrote: Pete Fordp...@justcroft.com wrote in message news:a4.c0.39221.b3ca3...@pb1.pair.com... On 22/02/11 05:40, Gary wrote: Can someone tell me why this is not working? I do

[PHP] Re: mysql_num_rows

2002-12-18 Thread liljim
Hi John, John Taylor-Johnston wrote in message: I use $mycounter, not saying it is pretty. But if you have a whole bunch of stuff deleted, your last id might be worth a lot more than the actual number of rows. $myconnection = mysql_connect($server,$user,$pass);

Re: [PHP] Re: mysql_num_rows

2002-12-18 Thread Philip Olson
First, there is no reason to do mycounter like this when mysql_num_rows() will work perfectly. It's not based on any certain column numbers or primary keys. Although if you're suggesting this method to simply print 0-n in the loop (as users may want to know the row number of output not any id

Re: [PHP] Re: mysql_num_rows

2002-12-18 Thread liljim
I would also tend to do a count(*) as well as the main query if I intend to use pagination (with the help of LIMIT in the main query). Suppose, for example, you're limiting to 30 news posts per page, and from calculations there are only 2 pages that fall into the criteria, then trying to bring

Re: [PHP] Re: mysql_num_rows

2002-12-18 Thread Philip Olson
And now mysql4 allows doing this another way, I *assume* this new way is slightly faster then the additional count() although I haven't tested it and wonder if it affects mysql_num_rows()... See: SQL_CALC_FOUND_ROWS() http://www.mysql.com/doc/en/Miscellaneous_functions.html Regards, Philip

[PHP] RE: mysql_num_rows

2002-12-17 Thread Roger Lewis
I found the problem! It was a space before $ in ' $name' in line two of the query. Sorry for the trouble. Roger -Original Message- From: Roger Lewis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 4:00 PM To: Php-General Subject: mysql_num_rows Would someone be kind enough

[PHP] Re: mysql_num_rows

2002-12-17 Thread John Taylor-Johnston
I use $mycounter, not saying it is pretty. But if you have a whole bunch of stuff deleted, your last id might be worth a lot more than the actual number of rows. $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query('select * from '.$table.'

[PHP] Re: mysql_num_rows error

2002-10-08 Thread Jonathan Duncan
Omar, I would first take the select statement and try running it in mysql to make sure it actually runs (substituting a valid value for the variable of course). Then if it has problems you can see what error messages mysql gives you. Good Luck, Jonathan Duncan Omar Campos [EMAIL PROTECTED]

[PHP] Re: mysql_num_rows error

2002-10-08 Thread David Robley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I have a file. I'll paste from line 32 to 34 ? . $sql = select USUARIO from docente where USUARIO = '$usuario'; $result = mysql_query($sql, $link); Replace the above line with (all on one line) $result = mysql_query($sql,

[PHP] RE: mysql_num_rows

2002-02-19 Thread Frank Miller
Thanks to everyone that replied. After trying solutions from everyone and still not getting it to work I finally figured out why my code: $result = mysql_query($query,$connection) or die(Error in Query); $num = mysql_num_rows($result); if ($num == 0) echo something; else echo

[PHP] Re: Mysql_num_rows

2002-02-18 Thread Corey Eiseman
Hi Frank, I'm not exactly sure what's up with this, I've definitely used something similar before without any problems. However, maybe you can work around it by switching the logic... if($num) echo blah, blah, blah; else echo There are no events scheduled today!; Wish I had a better