SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Having a mysql problem- not sure

    Here is the background:
    I have two sites which have identical code. With no changes to the code, and three successful transactions on the site since the last update, I am now getting an error on only one of the sites. There is a calendar that is "linked" to the db and the first indication of something wrong was that all the dates turned back to black (they are red when someone makes a reservation). I manually input a reservation and it seems like that is when the problems started. There is an updated cpanel (Accelerated version). I've done lots of these manual "reservations" (adding a record) and never a problem. This is the first one I didn't check before and after on (just my bad luck).

    I've attached a pic of both dbs table structure. One works perfectly and one does not. I don't want to touch the php code because it's the same on both sites. As you can see, there are some minor differences to the mysql tables. Can anyone tell me by glancing at this if it is the mysql causing my problem?
    Attached Images Attached Images
    Opportunity favors the prepared mind.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Did you check the content of the tables? If dates are shown as 'not reserved' then maybe you lost the reservation data?

  3. #3
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All of the data is there.
    Opportunity favors the prepared mind.

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Beats me
    If the data in the DB is correct, and the code is the same on both sites, I don't know why it shouldn't work.

  5. #5
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about the discrepancies in the table structures?
    Opportunity favors the prepared mind.

  6. #6
    SitePoint Guru
    Join Date
    Sep 2008
    Posts
    977
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well the table content seems to be different so I would take a look there to see what is different. I might optimise the table to to try to get rid of that overhead.

    bazz

  7. #7
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,014
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    According to the screenshots in the reservation_date table in the coyoteri_crreservation you have 157 rows. In the same table but in the rabbitju_rjreservation database you only have 144 rows. Have you manually added 13 rows to the reservation_date table in the coyoteri_crreservation database?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  8. #8
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have actually manually added some to both. The content of the records is different in each, though, whether I add new records manually or not
    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 IBazz View Post
    well the table content seems to be different so I would take a look there to see what is different. I might optimise the table to to try to get rid of that overhead.

    bazz

    What do you mean by overhead?
    Opportunity favors the prepared mind.

  10. #10
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Elsewhere someone suggested that there could have been an inadvertent change to the db table structure which is why the dbcontent is not recognizing it. I want to avoid changing the code. What might need to be changed within the db itself?
    Opportunity favors the prepared mind.

  11. #11
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Chri View Post
    What do you mean by overhead?
    Look at space usage. The table in the database to the right has overhead (more space allocated than really used). Optimizing the table, that unused space is freed.

  12. #12
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    Look at space usage. The table in the database to the right has overhead (more space allocated than really used). Optimizing the table, that unused space is freed.
    The one on the right is the one that functions properly.
    Opportunity favors the prepared mind.

  13. #13
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,014
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Have you (or your host) changed anything in terms of server configuration?

    Are any errors being given by MySQL for the INSERTS?

    Add an echo for each query after the query is made (for both databases) ie something like:

    PHP Code:
    echo $query
    Look at the query that has been echoed, does it contain all the values that you expect to be there? Are there any values of the wrong type, ie a string when your expecting an integer? Are there any NULL values where there shouldn't be?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  14. #14
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cPanel upgrade was done. I asked them about it and they couldn't find anything. could a cpanel upgrade affect one account and not the other? I get no errors when inserting records manually. However, when they uploaded the backup of the db, I now get a php error on the calculation end. I haven't run a query yet, but do you think if I created the db to match the one on the right it would correct the error?
    Opportunity favors the prepared mind.

  15. #15
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Solution.... Somehow the user permissions in cpanel were changed
    Opportunity favors the prepared mind.


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
  •