Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

php mysql question

Options
  • 12-07-2007 9:48am
    #1
    Registered Users Posts: 648 ✭✭✭


    hi i have a large db and when i export it i get

    INSERT INTO `places` VALUES (294, 'ae', 'badiya', 'Badiya', '04', '25.4313889', '56.3483333\n', 0, '');


    anyone know how to get rid of the \n you see above - considering i have 2.5 mil rows on that table?

    tnx


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    You could use the replace() function to remove all of the trailing \n's.

    I'd say test it before doing anything with it. Compare the below queries;

    SELECT myCol FROM places LIMIT 0, 50
    SELECT REPLACE(myCol, '\n', '') FROM places LIMIT 0, 50

    The first should give you the raw data, the second should give you the same data, just with the newline characters removed.

    I'm also not sure if MySQL recognises the \n as a newlines character. Try

    SELECT RTRIM(myCol) from Places LIMIT 0, 50

    And see what it shows you.


Advertisement