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
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
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
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
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
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);
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
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
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
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
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.'
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]
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,
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
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
15 matches
Mail list logo