FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » query with empty resultset (but the same one, used in phpmyadmin, gives results!!)
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
query with empty resultset (but the same one, used in phpmyadmin, gives results!!) [message #175349] Sat, 10 September 2011 10:41 Go to previous message
SatBoy78 is currently offline  SatBoy78
Messages: 2
Registered: September 2011
Karma:
Junior Member
Hi, I'm having some problems with a query, that gives results if used
in phpmyadmin, but when I use it in my php page I'll get an empty
resultset

the query is

select * from brucisys_homecalciobet.bollahome where (DAY(Data)
between 9 and 11) and (MONTH(Data) = 9) and (YEAR(Data) = 2011)

and, as told, gives some results


in my php page I've written this:

$dayStart=9;
$dayEnd=11;
$month=09;
$year=2011;

$rs0 = mysql_query("select * from brucisys_homecalciobet.bollahome
where (DAY(Data) between ".$dayStart." and ".$dayEnd.") and
(MONTH(Data) = ".$month.") and (YEAR(Data) = ".$year.")");

but the resultset is empty; infact I've done this little test

$returned_rows = mysql_num_rows ($rs0); echo "n. ".$returned_rows;

and it shows n. 0


Do you have any idea? wherei'm wrong?

Thanks a lot for your help

Have a nice day
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HOW TO: Spice up Your Site With Simple PHP
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 11:52:29 GMT 2024

Total time taken to generate the page: 0.04331 seconds