SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't add a date to November

    I have a calendar, which on the front end fills when reservation is made via php. All months allow a date insertion except November 08, whether I use the front end or in phpmyadmin. I've tried at least 10 times. Could anyone help me? I have never had a problem like this. What do you need to help?

    I do get an error message in phpmyadmin, but I get the same message for the dates that do fill, and sometimes, I don't get the message for dates that do fill. This is a nightmare.
    Opportunity favors the prepared mind.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    of course you can't add a date to november, it already has 30 and that's plenty


    just kidding!!



    we can't help you if we can't see your sql
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    which part do you need to see? I am really at a loss here.
    Opportunity favors the prepared mind.

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    the part that begins with INSERT INTO ...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is one error I get, but even when I get this error for other months, the field gets filled on the calendar

    Inserted rows: 1
    Warning: #1366 Incorrect integer value: '' for column 'reservation_id' at row 1
    Opportunity favors the prepared mind.

  6. #6
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    the part that begins with INSERT INTO ...
    INSERT INTO `rabbitju_rjreservation`.`reservation__date` (`reservation_id`, `reservation_date`) VALUES ('', '2008-11-26');
    Opportunity favors the prepared mind.

  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    the INTO clause should specify a table, not a column

    is rabbitju_rjreservation your database and reservation__date your table?

    or is rabbitju_rjreservation your table and reservation__date your column?

    and i would not try to insert a string into a numeric column -- in fact, if it's an auto_increment, i would simply omit it from the query
    Code:
     
    INSERT 
      INTO rabbitju_rjreservation 
         ( reservation_date ) 
    VALUES 
         ( '2008-11-26' );
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  8. #8
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    would this apply even though the other months work?
    Opportunity favors the prepared mind.

  9. #9
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    the INTO clause should specify a table, not a column

    is rabbitju_rjreservation your database and reservation__date your table?

    or is rabbitju_rjreservation your table and reservation__date your column?

    and i would not try to insert a string into a numeric column -- in fact, if it's an auto_increment, i would simply omit it from the query
    Code:
     
    INSERT 
      INTO rabbitju_rjreservation 
         ( reservation_date ) 
    VALUES 
         ( '2008-11-26' );
    I think reservation_date is a table.
    Opportunity favors the prepared mind.

  10. #10
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    could you do a SHOW CREATE TABLE please?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  11. #11
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    could you do a SHOW CREATE TABLE please?
    OMG I think I am in way over my head. I don't know how to do that. When I tried to input the november date, it automatically gave me the INSERT line I posted. The script is run from php on the server. Am I having a php prob or a mysql? I thought mysql because I was able to input some october dates, although I got the same error message.
    Opportunity favors the prepared mind.

  12. #12
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    what are you using as your front end testing tool? phpmyadmin? (i'm using HeidiSQL)

    go to the SQL tab, where you can test your queries, and type this in:
    Code:
    SHOW CREATE TABLE reservation_date
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  13. #13
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using pma


    Error

    SQL query:

    SHOW CREATE TABLE reservation_date

    MySQL said: Documentation
    #1146 - Table 'rabbitju_rjreservation.reservation_date' doesn't exist
    Opportunity favors the prepared mind.

  14. #14
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    try
    Code:
    SHOW CREATE TABLE reservation__date
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  15. #15
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I may have discovered something, it may not be a mysql prob
    my php script designates an id number, but it seems more or less arbitrary (I didn't create the script). when I input november, i gave it a zero. But there was an october date already using zero. so I typed in 40, just to pick a number. I did not get a mysql error, but the number still won't fill in the calendar on the front end. Am I having a php problem? Below are the dates that are actually filled on the calendar on the web page

    Edit Delete 0 2008-10-18
    Edit Delete 0 2008-10-17
    Edit Delete 0 2008-10-16
    Edit Delete 100 2008-08-14
    Edit Delete 100 2008-08-13
    Edit Delete 100 2008-08-12
    Edit Delete 94 2008-08-02
    Edit Delete 94 2008-08-01
    Edit Delete 92 2008-07-28
    Edit Delete 92 2008-07-27
    Edit Delete 92 2008-07-26
    Edit Delete 92 2008-07-25
    Edit Delete 84 2008-05-25
    Edit Delete 84 2008-05-24
    Edit Delete 84 2008-05-23
    Opportunity favors the prepared mind.

  16. #16
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    please do a SHOW CREATE TABLE for the table

    yes, i suspect you are having a php problem, and it has nothing to do with november

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  17. #17
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    please do a SHOW CREATE TABLE for the table

    yes, i suspect you are having a php problem, and it has nothing to do with november

    Error

    SQL query:

    SHOW CREATE TABLE reservation_date

    MySQL said: Documentation
    #1146 - Table 'rabbitju_rjreservation.reservation_date' doesn't exist

    How could it have nothing to do with november when nov is the only prob? should I post in php forum?
    Opportunity favors the prepared mind.

  18. #18
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could this be happening because I have a column and a table with the same name?
    Opportunity favors the prepared mind.

  19. #19
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    probably

    are there any additional columns in the reservation_date table besides the id and the reservation_date column?

    if not, i'm wondering how this table could be necessary...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  20. #20
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there are no other columns, but this is the table where the date and id go in. if I deleted it, I would be getting rid of all reservations.
    Opportunity favors the prepared mind.

  21. #21
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    what are you reserving?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  22. #22
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    what are you reserving?
    nightly stays at a vacation home
    Opportunity favors the prepared mind.

  23. #23
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    how do you know who has reserved it?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  24. #24
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    we get an email
    Opportunity favors the prepared mind.

  25. #25
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,347
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    i don't think that works

    if i look at the table and see that the vacation home is reserved for the following dates --

    2008-08-21
    2008-08-22
    2008-08-24

    how do i look up who reserved it for the 22nd? surely this isn't the only table in your database and you have to go manually browsing through your email folders to find out who reserved it!!!
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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