Why this works on MYSQL command line but not in php?
Posted: Fri Jun 26, 2009 8:15 am
I don't have a clue as to why this does not work in php, but it does, when I copy and paste the select statement directly into the mysql command line. I get a blank screen when I run this on php; I connect to the db successfully. Can anyone tell me why it would not show?
Code: Select all
<?php
include ('connect_db.php');
function selectfrom()
{
$rs7 = mysql_query ("SELECT item1, COUNT(item1) from products where Date > DATE_ADD(CURDATE(), INTERVAL -25 DAY group by item1)");
while($row7 = mysql_fetch_array($rs7))
{
echo $row7['item1']." ".$row7['COUNT(item1)']."<br>";
}
}
selectfrom();
?>