Results 1 to 4 of 4

Thread: Upgrading from mySQL 4 to mySQL 5

  1. #1
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default Upgrading from mySQL 4 to mySQL 5

    I just moved a site from a host with mySQL 4 to one with mySQL 5. One thing that stopped working was the ability to accept characters like apostrophes in text fields. So when users try to add events to the calendar, they get an error message if the text has even one apostrohe

    Is this the correct way to fix it?

    Code:
    string htmlspecialchars ( string $string [, int $quote_style [, string $charset [, bool $double_encode ]]] )
    This is the original code that no longer works:

    Code:
    <?php echo htmlspecialchars ( $description ); ?>
    Or is there a better way? The host techs told me it was impossible, but this seems ludicrous to me. It is a community events calendar and the users have been able to do it no problem for 8 years (until now), with the above code. I doubt the developers would make mySQL worse as it gets older. Any ideas?

    There are problems with the phpMyAdmin as well but I'll ask about that later.

    Thanks in advance for your help. erin

  2. #2
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    OK, I figured this one out. I just had to turn magic_quotes on in the php.ini file.

    ; Magic quotes for incoming GET/POST/Cookie data.
    magic_quotes_gpc = On

    I do understand that this has been deprecated in php6, and that it can allow SQL injection attacks, but this is just a fix until I can upgrade the underlying code to a newer version. I learned that the proper way to deal with it is to use addslashes and $POST_ variables[ ].

    Hope this helps someone avoid what I just went through. erin

  3. #3
    Join Date
    May 2008
    Posts
    17
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default

    Well, this helps me. I had the same problem.

  4. The Following User Says Thank You to shotgun_ninja For This Useful Post:

    kuau (05-16-2008)

  5. #4
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Great! I guess the Subject line is rather misleading, but the hosting techs tried to tell me that any problem I was having was due to importing a version 4 database into mySQL 5. I have since learned that everything they told me was a crock and I am changing to a new host because of it. They wasted so much of my time by telling me BS. This particular problem was obviously because of a setting in the php.ini on the previous host that I didn't know about. It took all of 2 minutes to fix it once I knew what it was. erin

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
  •