We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3071
    • 99 Posts
    Hi

    I am trying to produce 100webpages so inserting them into the mysql database seems the quickest way to do this. I have, at length, created an Excel sheet to do this, however, when I try to import my data, it won’t because I have apostrophes within my content, example:

    (23, ’document’, ’text/html’, ’John’s Title Tag | My Modx SIte’, ’John’s Main Headdin’, ’The met description,’, ’the-page-url’, ’’, 1, 1285709362, 0, 0, 0, ’’, ’’, 1, 8, 10, 1, 1, 2, 1285709368, 1, 1285878160, 0, 0, 0, 1285709368, 2, ’’, 0, 0, 0, 0, 0, 0, 0);

    I have tried playing around with the character encoding but still no luck. I know that if I go to the CMS there is no issue at all with me manually entering apostrophes but I just can’t figure out how to do this straight to the mysql database and it’s is driving me mad!! Does anyone have any idea how this can be done?
      • 3071
      • 99 Posts
      Hi, thanks for the response. I first export the database into .mysql, then I open it in a text editor and copy it into Excel Then I had to split each section down so that the main ones could be edited without me having to put commas in them. Then..after all this, I concatenate the row so that when it spits out the output row, everything is back to where it should be, I then import it back to the database. I have no idea how to do this easier but I am sure there must be a way to do it. WHen I import the file back, it stops at the first apostrophe that is within my first row and won’t import as it sees this as part of the mysql code. I need the database to ignore the apostrophes that are included within my page content. Scratching my head here!!
        • 25037
        • 32 Posts
        Mysql expects single quotes to be "escaped" with a backslash in front. But don’t do this yourself. Use an import/export tool (like phpmyadmin as already mentioned) that takes care of all the potential problems for you.