Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    UK
    Posts
    837

    Need Help On MYsql Query

    Hi Everyone

    im doing a Ramadhan TimeTable for this year to display on a Website

    I Have 4 Fields

    Day (0-30)
    Date (0-31)
    Sunrise (HH:MM)
    Sunet (HH:MM)

    What I want to do basically on the Website Display the following

    Day : Date
    Sunrise : Sunet

    Displaying the times for sunrise and Sunset for 2day

    and also have an extra for displaying times for sunrise and Sunset for 2moro

    anyone know a query or how i would do this pleasE?

    Thanks

  2. #2
    Join Date
    Mar 2006
    Posts
    965

  3. #3
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    Code:
    mysql> create table timings (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, thedate DATE, sunrise TIME, sunset TIME);
    Query OK, 0 rows affected (0.01 sec)
    
    mysql> insert into timings values ('',NOW(),NOW(),NOW());
    Query OK, 1 row affected, 1 warning (0.04 sec)
    
    mysql> select * from timings;
    +----+------------+----------+----------+
    | id | thedate    | sunrise  | sunset   |
    +----+------------+----------+----------+
    |  1 | 2006-09-17 | 08:49:52 | 08:49:52 |
    +----+------------+----------+----------+
    1 row in set (0.00 sec)
    
    mysql> select dayofmonth(thedate) as monthday, thedate, sunrise, sunset from timings;
    +----------+------------+----------+----------+
    | monthday | thedate    | sunrise  | sunset   |
    +----------+------------+----------+----------+
    |       17 | 2006-09-17 | 08:49:52 | 08:49:52 |
    +----------+------------+----------+----------+
    1 row in set (0.00 sec)
    
    mysql>
    Hope that helps
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •