Results 1 to 5 of 5

Thread: line break in mySql

  1. #1
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default line break in mySql

    is it possible to add sql string entry with line breaks?
    ive tried the expression \n but it didnt work when parsing with php
    Last edited by ggalan; 07-21-2010 at 11:47 PM.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Yes, but it depends on the format.

    For example:
    $line = "\n";
    mysql_query('......'.$line.'.....');

    That would work.

    Also, you can just add a line break in the query:
    mysql_query('one
    two');

    If you still have trouble, you'll need to post some code so we can help.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    i didnt know you can add an actual line break in the query!
    thanks

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    MySQL is a full programming language, though often it is used through a language like PHP.

    If you want to see an example of lots of MySQL code, with comments and many line breaks, just look at the backup from a database (such as generated from phpmyadmin).

    Glad to hear it works.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes you can and the syntax is correct that is given by the earlier post

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
  •