help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indenting SQL in php_mode


From: Ian Eure
Subject: Re: indenting SQL in php_mode
Date: Mon, 8 Dec 2008 09:38:58 -0800

On Dec 8, 2008, at 8:27 AM, Lennart Borgman wrote:

On Mon, Dec 8, 2008 at 3:01 PM, Frank Thieme <address@hidden> wrote:
On Mo 08 Dez 2008 14:32, "Lennart Borgman" <address@hidden> writes:

Could you please show me some examples of how sql in php look? (Delimiters etc.)

I don't know whether there is a standard, but I do it like this:

$query = "SELECT field1,
               field2,
               field3
        FROM table1 t1,
             table2 t2
        WHERE t1.foo = t2.bar
          AND field1 = 'foobar'";

Thanks, Frank, but I thoiught you meant a file with mixed php and sql
code, or? How does the delimiters from the php code look?

It's not like PHP-in-HTML, where there are explicit delimiters. It's just stored in a variable as a long string.

You'd have to use the variable declaration as the delimiter and force people to use $sql (or whatever).

 - Ian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]