Quarter question..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI all,

In the code below I'm trying to get the last column to show 1, 2, 3, or 4 
according to which quarter of the year it is. But all it shows in that column 
is " Resource ID # X". The X starts with #3 and goes to 18. There are (at the 
moment) 15 items in the table.  Any ideas what's wrong?

Thanks

JIM

#############################
<?php
echo "<table border=1> \n";
$i=1;
while ($myrow = mysql_fetch_array($result)) {
if($i % 2) { //this means if there is a remainder
        echo "<TR bgcolor=\"yellow\">\n";
    } else { //if there isn't a remainder we will do the else
        echo "<TR bgcolor=\"white\">\n";
    }
$qdate=$myrow["date"];
$sql = "select quarter($qdate)" or die("not work #3");
$yyy = mysql_query ($sql) or die("not work #4");

printf("<td><a href=\"%s?id=%s&delete=yes\">Delete</a></td>", $PHP_SELF, 
$myrow["id"]);
printf("<td><a href=\"%s?id=%s&submit=yes\">Update</td><td>%s</td><td>  
%s</td><td>  %s</td></a></tr>", 
	"update-inv.php", $myrow["id"], $myrow["name"], $myrow["details"], $yyy);
$i=$i+1;
}
echo "</table>\n";
}
?>
#############################

-- 
Jim Hatridge
Linux User #88484
------------------------------------------------------
                 BayerWulf
	   Linux System # 129656
         The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux