Re: String variable

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

 



2009/1/11 Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx>:
> On Sun, 2009-01-11 at 14:36 +0000, Ashley Sheridan wrote:
>> On Sun, 2009-01-11 at 08:59 -0500, MikeP wrote:
>> > Hello,
>> > I am trying yo get THIS:
>> > where ref_id = '1234'
>> > from this.
>> > $where="where ref_id="."'$Reference[$x][ref_id]'";
>> >
>> > but i certainly have a quote problem.
>> >
>> > Any help?
>> > Thanks
>> > Mike
>> >
>> >
>> >
>> >
>>
>> It should look like this:
>>
>> $where="where ref_id="'{$Reference[$x][ref_id]}'";
>>
>>
>> Ash
>> www.ashleysheridan.co.uk
>>
>>
> Sorry, it should look like this:
>
> $where="where ref_id='{$Reference[$x][ref_id]}'";
>
> I missed taking an extra quote mark out

Closer, but still not quite there. For encapsulation in the string, it
should look like:

$where = "where ref_is='{$Reference[$x]['ref_id']}'";

Someone else mentioned casting to int first as well to sanitize, which
is also a good idea.


Torben

> Ash
> www.ashleysheridan.co.uk




-- 
Torben Wilson <torben@xxxxxxxxxxxxx>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux