Re: [PHP] Fwd: Quarter question..

2002-11-03 Thread Jim Hatridge
Hi JS et al... Thanks! This was what I was looking for. Also thanks for the color code, much smaller! JIM On Saturday 02 November 2002 18:54, Jonathan Sharp wrote: > try this: > > -js > > > $i = 0; > while ( $myrow = mysql_fetch_array($result) ) > { > $c = ( ++$i % 2 ? 'yellow' : 'white

Re: [PHP] Fwd: Quarter question..

2002-11-02 Thread John Nichel
When you run mysql_query, it just sends back a resource id to the result set. To get the data, use something like mysql_fetch_array() $sql = "SELECT * FROM `myDataBase.myTable`"; if ( $result = @mysql_query ( $sql ) ) { while ( $data = @mysql_fetch_array ( $result, MYSQL_ASSOC ) ) { print_r (

Re: [PHP] Fwd: Quarter question..

2002-11-02 Thread Jonathan Sharp
try this: -js "; printf('Delete', $PHP_SELF, $myrow['id'] ); $q = ceil( 4/(int)date('n', strtotime($mydata['date']) )); printf('%s%s%s', 'update-inv.php', $myrow['id'], $myrow['name'], $myrow['details'], $q); } ?> Jim Hatridge wrote: > HI all, > > In the code below I'm trying to

[PHP] Fwd: Quarter question..

2002-11-02 Thread Jim Hatridge
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? Tha