• phpMyAdmin, how to insert a newline in a table?

    Home » Forums » Developers, developers, developers » Web design and development » phpMyAdmin, how to insert a newline in a table?

    Author
    Topic
    #471659

    How does one insert a newline character into a character field using phpMyAdmin?

    phpMyAdmin apparently doesn’t recognize an escape character. All of the instructions I’ve found say that if you want a special character you just type or paste it. Unfortunately you can’t type a newline in a phpMyAdmin field; it interprets the character as a click on the “Go” button. Nor can you paste one; if you try, nothing happens.

    BTW, I’m hoping for a solution that a non-technical client can use. I know I could do this by writing a SQL query, for example, but that won’t really give me what I need.

    Viewing 2 reply threads
    Author
    Replies
    • #1244345

      How does one insert a newline character into a character field using phpMyAdmin?

      Does Shift+Enter work? I mean, it will cause the cursor to move to the next line in a

    • #1244479

      phpMyAdmin considers Shift+Enter no different from Enter alone.

      I looked at the source sent to the browser and found that the form is one huge piece Javascript. I didn’t try to figure out what it’s doing, but it appears to edit character fields in , not textareas.

    • #1255647

      The problem I’m guessing is that phpmyadmin form, being text only, only accepts standard printing ascii characters, and so it does not accept the first 32 non-printing ones (which includes your desired carriage return). There is no real workaround, unless, as you say, you insert it directly with an sql query that stores the ascii character, since typing the ascii code using the Alt key + code usually fails too.

      However in standard use, you should not store a carriage return in a database, rather you should store an interpreted carriage return, so newline

      Code:
      n

      and carriage return

      Code:
      r

      characters which are valid for javascript, php etc, or if using html and then when viewing the data, interpret it.

    Viewing 2 reply threads
    Reply To: phpMyAdmin, how to insert a newline in a table?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: