[Top][All Lists]

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

Re: indenting SQL in php_mode

From: Lennart Borgman
Subject: Re: indenting SQL in php_mode
Date: Tue, 9 Dec 2008 01:10:38 +0100

On Mon, Dec 8, 2008 at 6:38 PM, Ian Eure <address@hidden> wrote:
> 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 =
>>>          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).

Ah, thanks, I see. This is of course possible to do, something similar
is done for style="..." in for example nxhtml-mumamo-mode. However
here it looks like something more flexible would be good. I will put
it on my todo-list.

reply via email to

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