Re: Manually Inserted Row

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

 



On Tue, October 31, 2006 1:20 pm, Keith Spiller wrote:
> RE:  Manually Inserted Row
>
> I'm using PHP to retrieve the values for the manual insert...  I
> originally
> tried using
> an array created from the mysql query and adding one row manaually and
> then
> sorting the multidimensional array.
>
> As Richard pointed out, sorting using the database would be much more
> efficient.
>
> So here I am.  Stuck again...
>
> (SELECT ID, Title, Label, Location, Start, End, Time, Description,
> Organization,
>   Department, Contact, Phone, Email, Global, Board, Committee, Status,
> TBD_Time ,
>   TO_DAYS(End) - TO_DAYS(Start) + 1 AS Days
>   FROM site_calendar_v2
> UNION
>   SELECT '99999', 'No events exist for this month...', '', '', '',
> '0000-00-00', '00:00:00',
>   '', '', '', '', '', '', '1', 'BOX', 'EOG', '', '',
>   as z )
> WHERE Board='BOX' AND Committee='EOG'
> ORDER BY z
>
>
> This fails.  Any ideas how I can fix this manually inserted row?

Dunno why if fails, but don't do that. :-)

Just do the select you want in the first place.  Then:

<?php
  if (mysql_num_rows($result) === 0){
    echo "No events exist for this month...";
  }
  while (list($id, $title, blah blah blah) = mysql_fetch_row($result)){
    echo "$id $title blah blah blah<br />n";
  }
?>

MUCH simpler!

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux